This commit is contained in:
Bjørn Erik Pedersen 2025-01-06 18:11:07 +01:00
commit 0fc86783ee
No known key found for this signature in database
33 changed files with 608 additions and 443 deletions

View file

@ -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 >}}