diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2024-01-27 10:47:28 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2024-01-27 10:47:28 +0100 |
commit | fc7de7136acbcf0aef54ae8460c7702bc83709be (patch) | |
tree | c109bb4dd1f1b054db476e7e4117f79bdd62ec9e /docs/content/en/functions/os/FileExists.md | |
parent | 1083bf7c08e6f35826279065b8a09a16cc991c7f (diff) | |
download | hugo-fc7de7136acbcf0aef54ae8460c7702bc83709be.tar.gz hugo-fc7de7136acbcf0aef54ae8460c7702bc83709be.zip |
docs: Prepare for new sub tree
See #11925
Diffstat (limited to 'docs/content/en/functions/os/FileExists.md')
-rw-r--r-- | docs/content/en/functions/os/FileExists.md | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/docs/content/en/functions/os/FileExists.md b/docs/content/en/functions/os/FileExists.md deleted file mode 100644 index b8104a066..000000000 --- a/docs/content/en/functions/os/FileExists.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -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] -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. - -With this directory structure: - -```text -content/ -├── about.md -├── contact.md -└── news/ - ├── article-1.md - └── article-2.md -``` - -The function returns these values: - -```go-html-template -{{ fileExists "content" }} → true -{{ fileExists "content/news" }} → true -{{ fileExists "content/news/article-1" }} → false -{{ fileExists "content/news/article-1.md" }} → true -{{ fileExists "news" }} → true -{{ fileExists "news/article-1" }} → false -{{ fileExists "news/article-1.md" }} → true -``` |