From bd58dd877a636f26495a8938c2d156380e33780a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 18 Apr 2019 09:36:47 +0200 Subject: [PATCH] Adjust Output Formats docs --- content/en/templates/output-formats.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/content/en/templates/output-formats.md b/content/en/templates/output-formats.md index e91a7bae1..1ab45e4c7 100644 --- a/content/en/templates/output-formats.md +++ b/content/en/templates/output-formats.md @@ -68,7 +68,7 @@ Given a media type and some additional configuration, you get an **Output Format This is the full set of Hugo's built-in output formats: -{{< datatable "output" "formats" "name" "mediaType" "path" "baseName" "rel" "protocol" "isPlainText" "isHTML" "noUgly">}} +{{< datatable "output" "formats" "name" "mediaType" "path" "baseName" "rel" "protocol" "isPlainText" "isHTML" "noUgly" "permalinkable" >}} * A page can be output in as many output formats as you want, and you can have an infinite amount of output formats defined **as long as they resolve to a unique path on the file system**. In the above table, the best example of this is `AMP` vs. `HTML`. `AMP` has the value `amp` for `Path` so it doesn't overwrite the `HTML` version; e.g. we can now have both `/index.html` and `/amp/index.html`. * The `MediaType` must match the `Type` of an already defined media type. @@ -121,7 +121,7 @@ The following is the full list of configuration options for output formats and t : enable if it doesn't make sense to include this format in an `AlternativeOutputFormats` format listing on `Page` (e.g., with `CSS`). Note that we use the term *alternative* and not *alternate* here, as it does not necessarily replace the other format. **Default:** `false`. `permalinkable` -: make `.Permalink` and `.RelPermalink` return the Output Format from the current template file rather than main ([see below](#link-to-output-formats)). **Default:** `false`. +: make `.Permalink` and `.RelPermalink` return the rendering Output Format rather than main ([see below](#link-to-output-formats)). This is enabled by default for `HTML` and `AMP`. **Default:** `false`. ## Output Formats for Pages @@ -192,9 +192,9 @@ Each `Page` has both an `.OutputFormats` (all formats, including the current) an __from `single.json.json`:__ ```go-html-template -{{ .Permalink }} > /that-page/ +{{ .RelPermalink }} > /that-page/ {{ with .OutputFormats.Get "json" -}} -{{ .Permalink }} > /that-page/index.json +{{ .RelPermalink }} > /that-page/index.json {{- end }} ``` @@ -203,9 +203,9 @@ In order for them to return the output format of the current template file inste __Same template file as above with json output format's `permalinkable` set to true:__ ```go-html-template -{{ .Permalink }} > /that-page/index.json +{{ .RelPermalink }} > /that-page/index.json {{ with .OutputFormats.Get "html" -}} -{{ .Permalink }} > /that-page/ +{{ .RelPermalink }} > /that-page/ {{- end }} ```