mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-22 21:42:50 +02:00
Merge commit 'b3d87dd0fd746f07f9afa6e6a2969aea41da6a38'
This commit is contained in:
30
docs/layouts/_shortcodes/quick-reference.html
Normal file
30
docs/layouts/_shortcodes/quick-reference.html
Normal file
@@ -0,0 +1,30 @@
|
||||
{{- /*
|
||||
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.
|
||||
|
||||
@example {{% quick-reference section="/functions" %}}
|
||||
*/ -}}
|
||||
{{ $section := "" }}
|
||||
{{ with .Get "section" }}
|
||||
{{ $section = . }}
|
||||
{{ else }}
|
||||
{{ errorf "The %q shortcode requires a 'section' parameter. See %s" .Name .Position }}
|
||||
{{ end }}
|
||||
|
||||
{{ with site.GetPage $section }}
|
||||
{{ range .Sections }}
|
||||
## {{ .LinkTitle }}{{/* Do not indent. */}}
|
||||
{{ .Description }}{{/* Do not indent. */}}
|
||||
{{ .Content }}
|
||||
{{ with .Pages }}
|
||||
{{ range . }}
|
||||
[{{ .LinkTitle }}]({{ .RelPermalink }}){{/* Do not indent. */}}
|
||||
: {{ .Description }}{{/* Do not indent. */}}
|
||||
{{ end }}
|
||||
{{ 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