From aeaaa42ce59038a56b1e33be64f52438012a8ccd Mon Sep 17 00:00:00 2001 From: Ryan Watters Date: Fri, 24 Feb 2017 03:06:06 -0600 Subject: [PATCH] Fix broken link in site variables --- content/functions/delimit.md | 16 +++++++++------- content/variables-and-params/site-variables.md | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/content/functions/delimit.md b/content/functions/delimit.md index 8a46e4fdc..f136bcf17 100644 --- a/content/functions/delimit.md +++ b/content/functions/delimit.md @@ -20,6 +20,12 @@ draft: false aliases: [] --- +`delimit` called in your template takes the form of + +``` +{{ delimit array/slice/map delimiter optionallastdelimiter}} +``` + `delimit` loops through any array, slice, or map and returns a string of all the values separated by a delimiter, the second argument in the function call. There is an optional third parameter that lets you choose a different delimiter to go between the last two values in the loop. To maintain a consistent output order, maps will be sorted by keys and only a slice of the values will be returned. @@ -35,19 +41,15 @@ tags: [ "tag1", "tag2", "tag3" ] ``` {{% /code %}} -`delimit` called in your template takes the form of -``` -{{ delimit array/slice/map delimiter optionallastdelimiter}} -``` -{{% code file="delimit-pages-tags.html" %}} +{{% code file="delimit-page-tags-input.html" %}} ```html

Tags: {{ delimit .Params.tags ", " }}

``` {{% /code %}} -{{% output "delimit-pages-tags-output.html" %}} +{{% output "delimit-page-tags-output.html" %}} ```html

Tags: tag1, tag2, tag3

``` @@ -55,7 +57,7 @@ tags: [ "tag1", "tag2", "tag3" ] Here is the same example but with the optional "last" delimiter: -{{% code file="delimit-page-tags-final-and.html" %}} +{{% code file="delimit-page-tags-final-and-input.html" %}} ```golang Tags: {{ delimit .Params.tags ", " ", and " }} ``` diff --git a/content/variables-and-params/site-variables.md b/content/variables-and-params/site-variables.md index 0ed2ee3ee..64ef4b231 100644 --- a/content/variables-and-params/site-variables.md +++ b/content/variables-and-params/site-variables.md @@ -34,7 +34,7 @@ The following is a list of site-level variables (aka "global"). Many of these va : a string representing the copyright of your website as defined in the site configuration. `.Site.Data` -: custom data, see [Data Templates](/templates/date-templates/). +: custom data, see [Data Templates](/templates/data-templates/). `.Site.DisqusShortname` : a string representing the shortname of the Disqus shortcode as defined in the site configuration.