Debian Codegraph @

docs/layouts/_shortcodes/get-page-desc.html

raw
1 {{/*
2 Returns the Description of the page specified by the logical path in the first
3 positional argument.
4
5 @param {string} logicalPath The logical path to the page.
6
7 @example {{% get-page-desc "/functions/reflect/isimageresource" %}}
8 */}}
9
10 {{- with $logicalPath := .Get 0 }}
11 {{- with $.Page.GetPage $logicalPath }}
12 {{- .Description }}
13 {{- else }}
14 {{- errorf "The %q shortcode was unable to find %s: see %s" $.Name $logicalPath $.Position }}
15 {{- end }}
16 {{- else }}
17 {{- errorf "The %q shortcode requires a positional argument with the logical path to the page: see %s" $.Name $logicalPath $.Position }}
18 {{- end -}}