diff options
Diffstat (limited to 'docs/content/en/functions/os')
-rw-r--r-- | docs/content/en/functions/os/FileExists.md | 16 | ||||
-rw-r--r-- | docs/content/en/functions/os/Getenv.md | 19 | ||||
-rw-r--r-- | docs/content/en/functions/os/ReadDir.md | 14 | ||||
-rw-r--r-- | docs/content/en/functions/os/ReadFile.md | 16 | ||||
-rw-r--r-- | docs/content/en/functions/os/Stat.md | 16 | ||||
-rw-r--r-- | docs/content/en/functions/os/_index.md | 7 |
6 files changed, 30 insertions, 58 deletions
diff --git a/docs/content/en/functions/os/FileExists.md b/docs/content/en/functions/os/FileExists.md index b8104a066..b8a01a3e7 100644 --- a/docs/content/en/functions/os/FileExists.md +++ b/docs/content/en/functions/os/FileExists.md @@ -3,19 +3,15 @@ title: os.FileExists description: Reports whether the file or directory exists. categories: [] keywords: [] -action: - aliases: [fileExists] - related: - - functions/os/Getenv - - functions/os/ReadDir - - functions/os/ReadFile - - functions/os/Stat - returnType: bool - signatures: [os.FileExists PATH] +params: + functions_and_methods: + aliases: [fileExists] + returnType: bool + signatures: [os.FileExists PATH] aliases: [/functions/fileexists] --- -The `os.FileExists` function attempts to resolve the path relative to the root of your project directory. If a matching file or directory is not found, it will attempt to resolve the path relative to the [`contentDir`](/getting-started/configuration#contentdir). A leading path separator (`/`) is optional. +The `os.FileExists` function attempts to resolve the path relative to the root of your project directory. If a matching file or directory is not found, it will attempt to resolve the path relative to the [`contentDir`](/configuration/all/#contentdir). A leading path separator (`/`) is optional. With this directory structure: diff --git a/docs/content/en/functions/os/Getenv.md b/docs/content/en/functions/os/Getenv.md index 2b7a08881..04215e6c3 100644 --- a/docs/content/en/functions/os/Getenv.md +++ b/docs/content/en/functions/os/Getenv.md @@ -3,17 +3,12 @@ title: os.Getenv description: Returns the value of an environment variable, or an empty string if the environment variable is not set. categories: [] keywords: [] -action: - aliases: [getenv] - related: - - functions/os/FileExists - - functions/os/ReadDir - - functions/os/ReadFile - - functions/os/Stat - returnType: string - signatures: [os.Getenv VARIABLE] +params: + functions_and_methods: + aliases: [getenv] + returnType: string + signatures: [os.Getenv VARIABLE] aliases: [/functions/getenv] -toc: true --- ## Security @@ -30,9 +25,7 @@ To access other environment variables, adjust your site configuration. For examp getenv = ['^HUGO_', '^CI$', '^USER$', '^HOME$'] {{< /code-toggle >}} -Read more about Hugo's [security policy]. - -[security policy]: /about/security/#security-policy +For more information see [configure security](/configuration/security). ## Examples diff --git a/docs/content/en/functions/os/ReadDir.md b/docs/content/en/functions/os/ReadDir.md index f4a5389d9..65c398a31 100644 --- a/docs/content/en/functions/os/ReadDir.md +++ b/docs/content/en/functions/os/ReadDir.md @@ -3,15 +3,11 @@ title: os.ReadDir description: Returns an array of FileInfo structures sorted by file name, one element for each directory entry. categories: [] keywords: [] -action: - aliases: [readDir] - related: - - functions/os/FileExists - - functions/os/Getenv - - functions/os/ReadFile - - functions/os/Stat - returnType: os.FileInfo - signatures: [os.ReadDir PATH] +params: + functions_and_methods: + aliases: [readDir] + returnType: os.FileInfo + signatures: [os.ReadDir PATH] aliases: [/functions/readdir] --- diff --git a/docs/content/en/functions/os/ReadFile.md b/docs/content/en/functions/os/ReadFile.md index 5e733ef2d..7f25327c8 100644 --- a/docs/content/en/functions/os/ReadFile.md +++ b/docs/content/en/functions/os/ReadFile.md @@ -3,19 +3,15 @@ title: os.ReadFile description: Returns the contents of a file. categories: [] keywords: [] -action: - aliases: [readFile] - related: - - functions/os/FileExists - - functions/os/Getenv - - functions/os/ReadDir - - functions/os/Stat - returnType: string - signatures: [os.ReadFile PATH] +params: + functions_and_methods: + aliases: [readFile] + returnType: string + signatures: [os.ReadFile PATH] aliases: [/functions/readfile] --- -The `os.ReadFile` function attempts to resolve the path relative to the root of your project directory. If a matching file is not found, it will attempt to resolve the path relative to the [`contentDir`](/getting-started/configuration#contentdir). A leading path separator (`/`) is optional. +The `os.ReadFile` function attempts to resolve the path relative to the root of your project directory. If a matching file is not found, it will attempt to resolve the path relative to the [`contentDir`](/configuration/all/#contentdir). A leading path separator (`/`) is optional. With a file named README.md in the root of your project directory: diff --git a/docs/content/en/functions/os/Stat.md b/docs/content/en/functions/os/Stat.md index 6b6f668de..63cb3f26a 100644 --- a/docs/content/en/functions/os/Stat.md +++ b/docs/content/en/functions/os/Stat.md @@ -3,19 +3,15 @@ title: os.Stat description: Returns a FileInfo structure describing a file or directory. categories: [] keywords: [] -action: - aliases: [] - related: - - functions/os/FileExists - - functions/os/Getenv - - functions/os/ReadDir - - functions/os/ReadFile - returnType: os.FileInfo - signatures: [os.Stat PATH] +params: + functions_and_methods: + aliases: [] + returnType: os.FileInfo + signatures: [os.Stat PATH] aliases: [/functions/os.stat] --- -The `os.Stat` function attempts to resolve the path relative to the root of your project directory. If a matching file or directory is not found, it will attempt to resolve the path relative to the [`contentDir`](/getting-started/configuration#contentdir). A leading path separator (`/`) is optional. +The `os.Stat` function attempts to resolve the path relative to the root of your project directory. If a matching file or directory is not found, it will attempt to resolve the path relative to the [`contentDir`](/configuration/all/#contentdir). A leading path separator (`/`) is optional. ```go-html-template {{ $f := os.Stat "README.md" }} diff --git a/docs/content/en/functions/os/_index.md b/docs/content/en/functions/os/_index.md index c080d0092..b125f7004 100644 --- a/docs/content/en/functions/os/_index.md +++ b/docs/content/en/functions/os/_index.md @@ -1,12 +1,7 @@ --- title: OS functions linkTitle: os -description: Template functions to interact with the operating system. +description: Use these functions to interact with the operating system. categories: [] keywords: [] -menu: - docs: - parent: functions --- - -Use these functions to interact with the operating system. |