github.com/rabbouni145/gg@v0.47.1/docs/content/en/functions/readdir.md (about) 1 --- 2 title: readDir 3 description: Gets a directory listing from a directory relative to the current working directory. 4 godocref: 5 date: 2017-02-01 6 publishdate: 2017-02-01 7 lastmod: 2017-02-01 8 categories: [functions] 9 menu: 10 docs: 11 parent: "functions" 12 keywords: [files] 13 signature: ["readDir PATH"] 14 workson: [] 15 hugoversion: 16 relatedfuncs: [readFile] 17 deprecated: false 18 aliases: [] 19 --- 20 21 If your current project working directory has a single file named `README.txt`: 22 23 ``` 24 {{ range (readDir ".") }}{{ .Name }}{{ end }} → "README.txt" 25 ``` 26 27 For more information on using `readDir` and `readFile` in your templates, see [Local File Templates][local]. 28 29 [local]: /templates/files/ 30