<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>OS functions on Hugo</title><link>https://v0-122-0--gohugoio.netlify.app/functions/os/</link><description>Recent content in OS functions on Hugo</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="https://v0-122-0--gohugoio.netlify.app/functions/os/index.xml" rel="self" type="application/rss+xml"/><item><title>os.FileExists</title><link>https://v0-122-0--gohugoio.netlify.app/functions/os/fileexists/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v0-122-0--gohugoio.netlify.app/functions/os/fileexists/</guid><description>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. A leading path separator (/) is optional.
With this directory structure:
content/ ├── about.md ├── contact.md └── news/ ├── article-1.md └── article-2.md The function returns these values:
{{ fileExists &amp;#34;content&amp;#34; }} → true {{ fileExists &amp;#34;content/news&amp;#34; }} → true {{ fileExists &amp;#34;content/news/article-1&amp;#34; }} → false {{ fileExists &amp;#34;content/news/article-1.</description></item><item><title>os.Getenv</title><link>https://v0-122-0--gohugoio.netlify.app/functions/os/getenv/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v0-122-0--gohugoio.netlify.app/functions/os/getenv/</guid><description>Security By default, when using the os.Getenv function Hugo allows access to:
The CI environment variable Any environment variable beginning with HUGO_ To access other environment variables, adjust your site configuration. For example, to allow access to the HOME and USER environment variables:
hugo. yaml &amp;nbsp; toml &amp;nbsp; json &amp;nbsp; security: funcs: getenv: - ^HUGO_ - ^CI$ - ^USER$ - ^HOME$ [security] [security.funcs] getenv = [&amp;#39;^HUGO_&amp;#39;, &amp;#39;^CI$&amp;#39;, &amp;#39;^USER$&amp;#39;, &amp;#39;^HOME$&amp;#39;] { &amp;#34;security&amp;#34;: { &amp;#34;funcs&amp;#34;: { &amp;#34;getenv&amp;#34;: [ &amp;#34;^HUGO_&amp;#34;, &amp;#34;^CI$&amp;#34;, &amp;#34;^USER$&amp;#34;, &amp;#34;^HOME$&amp;#34; ] } } } Read more about Hugo&amp;rsquo;s security policy.</description></item><item><title>os.ReadDir</title><link>https://v0-122-0--gohugoio.netlify.app/functions/os/readdir/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v0-122-0--gohugoio.netlify.app/functions/os/readdir/</guid><description>The os.ReadDir function resolves the path relative to the root of your project directory. A leading path separator (/) is optional.
With this directory structure:
content/ ├── about.md ├── contact.md └── news/ ├── article-1.md └── article-2.md This template code:
{{ range readDir &amp;#34;content&amp;#34; }} {{ .Name }} → {{ .IsDir }} {{ end }} Produces:
about.md → false contact.md → false news → true Note that os.ReadDir is not recursive.</description></item><item><title>os.ReadFile</title><link>https://v0-122-0--gohugoio.netlify.app/functions/os/readfile/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v0-122-0--gohugoio.netlify.app/functions/os/readfile/</guid><description>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. A leading path separator (/) is optional.
With a file named README.md in the root of your project directory:
This is **bold** text. This template code:
{{ readFile &amp;#34;README.md&amp;#34; }} Produces:
This is **bold** text. Note that os.</description></item><item><title>os.Stat</title><link>https://v0-122-0--gohugoio.netlify.app/functions/os/stat/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v0-122-0--gohugoio.netlify.app/functions/os/stat/</guid><description>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. A leading path separator (/) is optional.
{{ $f := os.Stat &amp;#34;README.md&amp;#34; }} {{ $f.IsDir }} → false (bool) {{ $f.ModTime }} → 2021-11-25 10:06:49.315429236 -0800 PST (time.Time) {{ $f.Name }} → README.md (string) {{ $f.</description></item></channel></rss>