docs: Add doc and a test for readDir

Fixes #2009
This commit is contained in:
Bjørn Erik Pedersen
2016-03-31 23:16:42 +02:00
parent cb89ae63e9
commit c2277fcbc1
2 changed files with 11 additions and 0 deletions

View File

@@ -121,6 +121,7 @@ safeURL: {{ "http://gohugo.io" | safeURL | safeURL }}
safeJS: {{ "(1*2)" | safeJS | safeJS }}
plainify: {{ plainify "Hello <strong>world</strong>, gophers!" }}
readFile: {{ readFile "README.txt" }}
readDir: {{ range (readDir ".") }}{{ .Name }}{{ end }}
`
expected := `chomp: <p>Blockhead</p>
dateFormat: Wednesday, Jan 21, 2015
@@ -166,6 +167,7 @@ safeURL: http://gohugo.io
safeJS: (1*2)
plainify: Hello world, gophers!
readFile: Hugo Rocks!
readDir: README.txt
`
var b bytes.Buffer