mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-25 22:00:58 +02:00
Merge commit 'a024bc7d76fcc5e49e8210f9b0896db9ef21861a'
This commit is contained in:
@@ -13,13 +13,12 @@ shortcode.
|
||||
|
||||
@example {{% glossary %}}
|
||||
*/}}
|
||||
{{- $path := "/getting-started/glossary" }}
|
||||
{{- $path := "/quick-reference/glossary" }}
|
||||
{{- with site.GetPage $path }}
|
||||
{{- with $p := .Pages.ByTitle }}
|
||||
|
||||
{{- /* Build and render alphabetical index. */}}
|
||||
{{- $m := dict }}
|
||||
{{- range $p }}
|
||||
{{- range $p := .Pages.ByTitle }}
|
||||
{{- $k := substr .Title 0 1 | strings.ToUpper }}
|
||||
{{- if index $m $k }}
|
||||
{{- continue }}
|
||||
@@ -32,12 +31,26 @@ shortcode.
|
||||
{{- end }}
|
||||
|
||||
{{- /* Render glossary terms. */}}
|
||||
{{- range $p }}
|
||||
{{- range $p := .Pages.ByTitle }}
|
||||
###### {{ .Title }}{{/* Do not indent. */}}
|
||||
{{ .RenderShortcodes }}{{/* Do not indent. */}}
|
||||
{{- with .Params.reference }}
|
||||
{{- $destination := "" }}
|
||||
{{- with $u := urls.Parse . }}
|
||||
{{- if $u.IsAbs }}
|
||||
{{- $destination = $u.String }}
|
||||
{{- else }}
|
||||
{{- with site.GetPage $u.Path -}}
|
||||
{{- $destination = .RelPermalink }}
|
||||
{{- else }}
|
||||
{{- errorf "The %q shortcode was unable to find the reference link %s: see %s" $.Name . $p.String }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
 See [details]({{ $destination }}).{{/* Do not indent. */}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- errorf "The %q shortcode was unable to get %s: see %s" .Name $path .Position}}
|
||||
{{- end }}
|
||||
|
Reference in New Issue
Block a user