{{ .Title }}
diff --git a/content/functions/where.md b/content/functions/where.md index 3aa03296b..e989ba352 100644 --- a/content/functions/where.md +++ b/content/functions/where.md @@ -140,7 +140,7 @@ This is especially important for themes, but to list the most relevant pages on This will, by default, list pages from the _section with the most pages_. -```html +```go-html-template {{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }} ``` diff --git a/content/news/0.27-relnotes-ready.md b/content/news/0.27-relnotes-ready.md index 3dd02d455..9251c3768 100644 --- a/content/news/0.27-relnotes-ready.md +++ b/content/news/0.27-relnotes-ready.md @@ -9,7 +9,7 @@ categories: ["Releases"] Hugo `0.27`comes with fast and flexible **Related Content** ([3b4f17bb](https://github.com/gohugoio/hugo/commit/3b4f17bbc9ff789faa581ac278ad109d1ac5b816) [@bep](https://github.com/bep) [#98](https://github.com/gohugoio/hugo/issues/98)). To add this to your site, put something like this in your single page template: -```html +```go-html-template {{ $related := .Site.RegularPages.Related . | first 5 }} {{ with $related }}See Also
diff --git a/content/news/0.27-relnotes.md b/content/news/0.27-relnotes.md index a4ead0816..92fc3a7b0 100644 --- a/content/news/0.27-relnotes.md +++ b/content/news/0.27-relnotes.md @@ -11,7 +11,7 @@ images: Hugo `0.27`comes with fast and flexible **Related Content** ([3b4f17bb](https://github.com/gohugoio/hugo/commit/3b4f17bbc9ff789faa581ac278ad109d1ac5b816) [@bep](https://github.com/bep) [#98](https://github.com/gohugoio/hugo/issues/98)). To add this to your site, put something like this in your single page template: -```html +```go-html-template {{ $related := .Site.RegularPages.Related . | first 5 }} {{ with $related }}See Also
diff --git a/content/templates/output-formats.md b/content/templates/output-formats.md index f51c0eb9b..31956713e 100644 --- a/content/templates/output-formats.md +++ b/content/templates/output-formats.md @@ -184,7 +184,7 @@ outputs: Each `Page` has both an `.OutputFormats` (all formats, including the current) and an `.AlternativeOutputFormats` variable, the latter of which is useful for creating a `link rel` list in your site's ``: -```html +```go-html-template {{ range .AlternativeOutputFormats -}} {{ end -}} @@ -194,7 +194,7 @@ Note that `.Permalink` and `.RelPermalink` on `Page` will return the first outpu This is how you link to a given output format: -```html +```go-html-template {{ with .OutputFormats.Get "json" -}} {{ .Name }} {{- end }} @@ -202,7 +202,7 @@ This is how you link to a given output format: From content files, you can use the [`ref` or `relref` shortcodes](/content-management/shortcodes/#ref-and-relref): -```html +```go-html-template [Neat]({{* ref "blog/neat.md" "amp" */>}}) [Who]({{* relref "about.md#who" "amp" */>}}) ``` diff --git a/layouts/shortcodes/code.html b/layouts/shortcodes/code.html index 83220c47d..2ee20b1eb 100644 --- a/layouts/shortcodes/code.html +++ b/layouts/shortcodes/code.html @@ -5,6 +5,9 @@ {{ $.Scratch.Set "codeLang" (index . 0 | strings.TrimPrefix ".") }} {{ end }} {{ with .Get "codeLang" }}{{ $.Scratch.Set "codeLang" . }}{{ end }} +{{ if eq (.Scratch.Get "codeLang") "html"}} +{{ $.Scratch.Set "codeLang" "go-html-template" }} +{{ end }}
{{- with $file -}}
{{.}}