Rename ReadDir to readDir - hugo - [fork] hugo port for 9front
(HTM) git clone git@git.drkhsh.at/hugo.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Submodules
(DIR) README
(DIR) LICENSE
---
(DIR) commit cea82842f0a8832b87afa2aaeae6b3843b4ef204
(DIR) parent 153332706a78d387225bc1d9e04bc8270cf49aff
(HTM) Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Date: Fri, 7 Aug 2015 14:33:48 +0200
Rename ReadDir to readDir
To make it consistent with the other template funcs.
Diffstat:
M docs/content/extras/localfiles.md | 10 +++++-----
M tpl/template_funcs.go | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
---
(DIR) diff --git a/docs/content/extras/localfiles.md b/docs/content/extras/localfiles.md
@@ -15,13 +15,13 @@ weight: 110
## Traversing Local Files
Hugo includes a way to traverse local files.
-This is done using the 'ReadDir' function.
+This is done using the 'readDir' function.
-## Using ReadDir
+## Using readDir
-ReadDir takes a single string input that is relative to the root directory of the site. It returns an array of [os.FileInfo](https://golang.org/pkg/os/#FileInfo)
+readDir takes a single string input that is relative to the root directory of the site. It returns an array of [os.FileInfo](https://golang.org/pkg/os/#FileInfo)
-Let's create a shortcode to build a file index with links using ReadDir.
+Let's create a shortcode to build a file index with links using readDir.
'fileindex.html'
@@ -31,7 +31,7 @@ Let's create a shortcode to build a file index with links using ReadDir.
{{$dir := .Get "dir"}}
{{ $url := .Get "baseurl" }}
- {{ $files := ReadDir $dir }}
+ {{ $files := readDir $dir }}
{{ range $files }}
<tr>
<td>{{.Size}}</td>
(DIR) diff --git a/tpl/template_funcs.go b/tpl/template_funcs.go
@@ -1369,7 +1369,7 @@ func init() {
"dateFormat": DateFormat,
"getJSON": GetJSON,
"getCSV": GetCSV,
- "ReadDir": ReadDir,
+ "readDir": ReadDir,
"seq": helpers.Seq,
"getenv": func(varName string) string { return os.Getenv(varName) },
}