os
Os is Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
os.FileExists
FileExists checks whether a file exists under the given path.
Aliases: fileExists
Examples
{{ fileExists "foo.txt" }}
false
os.Getenv
Getenv retrieves the value of the environment variable named by the key
.
It returns the value, which will be empty if the variable is not present.
Aliases: getenv
os.ReadDir
(i any) → _os.FileInfo
ReadDir lists the directory contents relative to the configured WorkingDir.
Aliases: readDir
Examples
{{ range (readDir "files") }}{{ .Name }}{{ end }}
README.txt
os.ReadFile
ReadFile reads the file named by filename relative to the configured WorkingDir. It returns the contents as a string. There is an upper size limit set at 1 megabytes.
Aliases: readFile
Examples
{{ readFile "files/README.txt" }}
Hugo Rocks!
os.Stat
Stat returns the os.FileInfo structure describing file.