-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{{- /* | ||
https://github.com/gohugoio/gohugoioTheme/blob/master/layouts/shortcodes/include.html | ||
|
||
Renders the page using the RenderShortcode method on the Page object. | ||
|
||
You must call this shortcode using the {{% %}} notation. | ||
|
||
@param {string} (postional parameter 0) The path to the page, relative to the content directory. | ||
@returns template.HTML | ||
|
||
@example {{% include "functions/_common/glob-patterns" %}} | ||
*/}} | ||
|
||
{{- with .Get 0 }} | ||
{{- with 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 }} |