summaryrefslogtreecommitdiffstats
path: root/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/quick-reference.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/quick-reference.html')
-rw-r--r--docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/quick-reference.html37
1 files changed, 37 insertions, 0 deletions
diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/quick-reference.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/quick-reference.html
new file mode 100644
index 000000000..250bfc065
--- /dev/null
+++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/quick-reference.html
@@ -0,0 +1,37 @@
+{{/*
+Renders the child sections of the given top-level section, listing each childs'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 .Postion }}
+{{ 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" }}
+ {{ $aliases = delimit .Params.action.aliases " or " }}
+ {{ 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 .Postion }}
+{{ end }}