From b3bd71fec90ea2680a68d28e7ac5e82f80eafdde Mon Sep 17 00:00:00 2001 From: Anthony Fok Date: Wed, 18 Mar 2015 00:44:12 -0600 Subject: [PATCH] Update Hugo docs with the initialisms suggested by golint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In particular: * .Url → .URL (for node, menu and paginator) * .Site.BaseUrl → .Site.BaseURL * getJson → getJSON * getCsv → getCSV * safeHtml → safeHTML * safeCss → safeCSS * safeUrl → safeURL Continued effort in fixing #959. --- docs/content/content/organization.md | 20 +++++----- docs/content/extras/dynamiccontent.md | 26 ++++++------- docs/content/extras/menus.md | 12 +++--- docs/content/extras/pagination.md | 10 ++--- docs/content/overview/configuration.md | 52 +++++++++++++------------- docs/content/taxonomies/displaying.md | 2 +- docs/content/templates/content.md | 4 +- docs/content/templates/functions.md | 26 ++++++------- docs/content/templates/go-templates.md | 8 ++-- docs/content/templates/homepage.md | 2 +- docs/content/templates/partials.md | 2 +- docs/content/templates/sitemap.md | 2 +- docs/content/templates/variables.md | 4 +- docs/layouts/partials/menu.html | 4 +- 14 files changed, 87 insertions(+), 87 deletions(-) diff --git a/docs/content/content/organization.md b/docs/content/content/organization.md index bf32aa699..7b887ef78 100644 --- a/docs/content/content/organization.md +++ b/docs/content/content/organization.md @@ -67,7 +67,7 @@ This isn't in the front matter, but is the actual name of the file minus the extension. This will be the name of the file in the destination. ### slug -Defined in the front matter, the slug can take the place of the filename for the +Defined in the front matter, the `slug` can take the place of the filename for the destination. ### filepath @@ -75,18 +75,18 @@ The actual path to the file on disk. Destination will create the destination with the same path. Includes [section](/content/sections/). ### section -section can be provided in the front matter overriding the section derived from +`section` can be provided in the front matter overriding the section derived from the source content location on disk. See [section](/content/sections/). ### path -path can be provided in the front matter. This will replace the actual +`path` can be provided in the front matter. This will replace the actual path to the file on disk. Destination will create the destination with the same path. Includes [section](/content/sections/). ### url A complete URL can be provided. This will override all the above as it pertains -to the end destination. This must be the path from the baseurl (starting with a "/"). -When a url is provided, it will be used exactly. Using url will ignore the +to the end destination. This must be the path from the baseURL (starting with a "/"). +When a `url` is provided, it will be used exactly. Using `url` will ignore the `--uglyUrls` setting. @@ -116,27 +116,27 @@ When a url is provided, it will be used exactly. Using url will ignore the http://spf13.com/projects/hugo - baseUrl section slug + baseURL section slug ⊢-----^--------⊣ ⊢--^---⊣ ⊢-^⊣ http://spf13.com/projects/hugo - baseUrl section slug + baseURL section slug ⊢-----^--------⊣ ⊢--^--⊣ ⊢--^--⊣ http://spf13.com/extras/indexes/example - baseUrl path slug + baseURL path slug ⊢-----^--------⊣ ⊢------^-----⊣ ⊢--^--⊣ http://spf13.com/extras/indexes/example - baseUrl url + baseURL url ⊢-----^--------⊣ ⊢-----^-----⊣ http://spf13.com/projects/hugo - baseUrl url + baseURL url ⊢-----^--------⊣ ⊢--------^-----------⊣ http://spf13.com/extras/indexes/example diff --git a/docs/content/extras/dynamiccontent.md b/docs/content/extras/dynamiccontent.md index 45fe2efd2..9691ede33 100644 --- a/docs/content/extras/dynamiccontent.md +++ b/docs/content/extras/dynamiccontent.md @@ -19,8 +19,8 @@ any [JSON](http://www.json.org/) or [CSV](http://en.wikipedia.org/wiki/Comma-separated_values) file from nearly any resource. -"Dynamic Content" currently consists of two functions, `getJson` -and `getCsv`, which are available in **all template files**. +"Dynamic Content" currently consists of two functions, `getJSON` +and `getCSV`, which are available in **all template files**. ## Implementation details @@ -28,33 +28,33 @@ and `getCsv`, which are available in **all template files**. In any HTML template or Markdown document, call the functions like this: - {{ $dataJ := getJson "url" }} - {{ $dataC := getCsv "separator" "url" }} + {{ $dataJ := getJSON "url" }} + {{ $dataC := getCSV "separator" "url" }} or, if you use a prefix or postfix for the URL, the functions accept [variadic arguments](http://en.wikipedia.org/wiki/Variadic_function): - {{ $dataJ := getJson "url prefix" "arg1" "arg2" "arg n" }} - {{ $dataC := getCsv "separator" "url prefix" "arg1" "arg2" "arg n" }} + {{ $dataJ := getJSON "url prefix" "arg1" "arg2" "arg n" }} + {{ $dataC := getCSV "separator" "url prefix" "arg1" "arg2" "arg n" }} -The separator for `getCsv` must be put in the first position and can only +The separator for `getCSV` must be put in the first position and can only be one character long. All passed arguments will be joined to the final URL; for example: {{ $urlPre := "https://api.github.com" }} - {{ $gistJ := getJson $urlPre "/users/GITHUB_USERNAME/gists" }} + {{ $gistJ := getJSON $urlPre "/users/GITHUB_USERNAME/gists" }} will resolve internally to: - {{ $gistJ := getJson "https://api.github.com/users/GITHUB_USERNAME/gists" }} + {{ $gistJ := getJSON "https://api.github.com/users/GITHUB_USERNAME/gists" }} Finally, you can range over an array. This example will output the first 5 gists for a GitHub user: