mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-29 07:00:31 +03:00
Merge commit 'e9fbadacc3
'
This commit is contained in:
commit
0fc86783ee
33 changed files with 608 additions and 443 deletions
|
@ -9,8 +9,14 @@ _comment: Do not remove front matter.
|
|||
The primary use case for `PageInner` is to resolve links and [page resources] relative to an included `Page`. For example, create an "include" shortcode to compose a page from multiple content files, while preserving a global context for footnotes and the table of contents:
|
||||
|
||||
{{< code file=layouts/shortcodes/include.html >}}
|
||||
{{ with site.GetPage (.Get 0) }}
|
||||
{{ .RenderShortcodes }}
|
||||
{{ with .Get 0 }}
|
||||
{{ with $.Page.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 logical path of the file to include. See %s" .Name .Position }}
|
||||
{{ end }}
|
||||
{{< /code >}}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue