mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-25 22:00:58 +02:00
Merge commit 'b3d87dd0fd746f07f9afa6e6a2969aea41da6a38'
This commit is contained in:
20
docs/layouts/_shortcodes/include.html
Normal file
20
docs/layouts/_shortcodes/include.html
Normal file
@@ -0,0 +1,20 @@
|
||||
{{/* prettier-ignore-start */ -}}
|
||||
{{- /*
|
||||
Renders the page using the RenderShortcode method on the Page object.
|
||||
|
||||
You must call this shortcode using the {{% %}} notation.
|
||||
|
||||
@param {string} (positional parameter 0) The path to the page, relative to the content directory.
|
||||
|
||||
@example {{% include "functions/_common/glob-patterns" %}}
|
||||
*/ -}}
|
||||
{{/* prettier-ignore-end */ -}}
|
||||
{{- with .Get 0 }}
|
||||
{{- with or ($.Page.GetPage .) (site.GetPage .) }}
|
||||
{{- .RenderShortcodes }}
|
||||
{{- else }}
|
||||
{{- errorf "The %q shortcode was unable to find %q. See %s" $.Name . $.Position }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- errorf "The %q shortcode requires a positional parameter indicating the path of the file to include. See %s" .Name .Position }}
|
||||
{{- end }}
|
Reference in New Issue
Block a user