mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-14 20:14:38 -04:00
parent
7bf0d43ba8
commit
07e9963f66
@ -337,6 +337,15 @@ e.g.
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
## Files
|
## Files
|
||||||
|
|
||||||
|
### readDir
|
||||||
|
|
||||||
|
Gets a directory listing from a directory relative to the current project working dir.
|
||||||
|
|
||||||
|
So, If the project working dir has a single file named `README.txt`:
|
||||||
|
|
||||||
|
`{{ range (readDir ".") }}{{ .Name }}{{ end }}` → "README.txt"
|
||||||
|
|
||||||
### readFile
|
### readFile
|
||||||
Reads a file from disk and converts it into a string. Note that the filename must be relative to the current project working dir.
|
Reads a file from disk and converts it into a string. Note that the filename must be relative to the current project working dir.
|
||||||
So, if you have a file with the name `README.txt` in the root of your project with the content `Hugo Rocks!`:
|
So, if you have a file with the name `README.txt` in the root of your project with the content `Hugo Rocks!`:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user