Files

43 lines
1.2 KiB
HTML

{{/* prettier-ignore-start */ -}}
{{- /*
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" >}}
*/ -}}
{{/* prettier-ignore-end */ -}}
{{ $section := "" }}
{{ with .Get "section" }}
{{ $section = . }}
{{ else }}
{{ errorf "The %q shortcodes requires a 'section' parameter. See %s" .Name .Position }}
{{ end }}
{{ with site.GetPage $section }}
{{ range .Sections }}
<h2>{{ .LinkTitle }}</h2>
{{ .Content }}
{{ with .Pages }}
<dl>
{{ range . }}
{{ $aliases := "" }}
{{ if eq .Section "functions" }}
{{ with .Params.functions_and_methods.aliases }}
{{ $aliases = delimit . " or " }}
{{ end }}
{{ end }}
<dt>
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
{{ with $aliases }}<span class="font-normal text-stone-700">({{ . }})</span>{{ end }}
</dt>
<dd>{{ .Description }}</dd>
{{ end }}
</dl>
{{ end }}
{{ end }}
{{ else }}
{{ errorf "The %q shortcodes was unable to find the %q section. See %s" .Name $section .Position }}
{{ end }}