File: quick-reference.html

package info (click to toggle)
hugo 0.155.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 43,600 kB
  • sloc: javascript: 31,879; ansic: 2,350; xml: 350; makefile: 196; sh: 110
file content (31 lines) | stat: -rw-r--r-- 966 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{{- /*
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 . }}
{{/* Use page Path as the link destination for render hook to resolve correctly. */}}
[{{ .LinkTitle }}]({{ .Path }}){{/* 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 }}