mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
Merge commit '346b60358dd8ec2ca228e6635bff9d7914b398b7'
This commit is contained in:
@@ -9,13 +9,13 @@ action:
|
||||
signatures: [PAGE.Page]
|
||||
---
|
||||
|
||||
This is a convenience method, useful within partial templates that are called from both [shortcodes] and page templates.
|
||||
This is a convenience method, useful within partial templates that are called from both [shortcodes](g) and page templates.
|
||||
|
||||
{{< code file=layouts/shortcodes/foo.html >}}
|
||||
{{ partial "my-partial.html" . }}
|
||||
{{< /code >}}
|
||||
|
||||
When the shortcode calls the partial, it passes the current [context] (the dot). The context includes identifiers such as `Page`, `Params`, `Inner`, and `Name`.
|
||||
When the shortcode calls the partial, it passes the current [context](g) (the dot). The context includes identifiers such as `Page`, `Params`, `Inner`, and `Name`.
|
||||
|
||||
{{< code file=layouts/_default/single.html >}}
|
||||
{{ partial "my-partial.html" . }}
|
||||
@@ -34,7 +34,3 @@ And yes, that means you can do `.Page.Page.Page.Page.Title` too.
|
||||
|
||||
But don't.
|
||||
{{% /note %}}
|
||||
|
||||
|
||||
[context]: getting-started/glossary/#context
|
||||
[shortcodes]: /getting-started/glossary/#shortcode
|
||||
|
Reference in New Issue
Block a user