From 261d3d3ecdc970d6c4ed383b476d91848a091bc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Fri, 7 Aug 2015 14:33:48 +0200 Subject: [PATCH] Rename ReadDir to readDir To make it consistent with the other template funcs. --- content/extras/localfiles.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/content/extras/localfiles.md b/content/extras/localfiles.md index 2cfcda49e..14d425079 100644 --- a/content/extras/localfiles.md +++ b/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 }} {{.Size}}