mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Merge commit 'a024bc7d76fcc5e49e8210f9b0896db9ef21861a'
This commit is contained in:
39
docs/layouts/shortcodes/quick-reference.html
Normal file
39
docs/layouts/shortcodes/quick-reference.html
Normal file
@@ -0,0 +1,39 @@
|
||||
{{/*
|
||||
Renders the child sections of the given top-level section, listing each child's immediate descendants.
|
||||
|
||||
@param {string} section The top-level section to render.
|
||||
@returns template.HTML
|
||||
|
||||
@example {{% quick-reference section="functions" %}}
|
||||
*/}}
|
||||
|
||||
{{ $section := "" }}
|
||||
{{ with .Get "section" }}
|
||||
{{ $section = . }}
|
||||
{{ else }}
|
||||
{{ errorf "The %q shortcodes requires a 'section' parameter. See %s" .Name .Position }}
|
||||
{{ end }}
|
||||
|
||||
{{/* Do not change the markdown indentation, and do not remove blank lines. */}}
|
||||
{{ with site.GetPage $section }}
|
||||
{{ range .Sections }}
|
||||
|
||||
## {{ .LinkTitle }}
|
||||
{{ .RawContent }}
|
||||
|
||||
{{ range .Pages }}
|
||||
{{ $aliases := "" }}
|
||||
{{ if eq .Section "functions" }}
|
||||
{{ with .Params.action.aliases }}
|
||||
{{ $aliases = delimit . " or " }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
[{{ .LinkTitle }}]({{ .RelPermalink }}) {{ with $aliases }}({{ . }}){{ end }}
|
||||
: {{ .Description }}
|
||||
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ errorf "The %q shortcodes was unable to find the %q section. See %s" .Name $section .Position }}
|
||||
{{ end }}
|
Reference in New Issue
Block a user