Merge commit 'b3d87dd0fd746f07f9afa6e6a2969aea41da6a38'

This commit is contained in:
Bjørn Erik Pedersen
2025-04-24 10:23:16 +02:00
101 changed files with 503 additions and 164 deletions

View File

@@ -1,6 +1,6 @@
---
title: Embedded templates
description: Hugo provides embedded templates for common use cases.
title: Embedded partial templates
description: Hugo provides embedded partial templates for common use cases.
categories: []
keywords: []
weight: 170
@@ -145,6 +145,10 @@ Various optional metadata can also be set:
If using YouTube this will produce a og:video tag like `<meta property="og:video" content="url">`. Use the `https://youtu.be/<id>` format with YouTube videos (example: `https://youtu.be/qtIqKaDlqXo`).
## Pagination
See [details](/templates/pagination/).
## Schema
> [!note]

View File

@@ -49,7 +49,7 @@ As shown in the above example directory structure, you can nest your directories
### Variable scoping
The second argument in a partial call is the variable being passed down. The above examples are passing the `.`, which tells the template receiving the partial to apply the current [context][context].
The second argument in a partial call is the variable being passed down. The above examples are passing the dot (`.`), which tells the template receiving the partial to apply the current [context][context].
This means the partial will *only* be able to access those variables. The partial is isolated and cannot access the outer scope. From within the partial, `$.Var` is equivalent to `.Var`.

View File

@@ -329,7 +329,7 @@ You can use the `HasShortcode` method in your base template to conditionally loa
[`with`]: /functions/go-template/with/
[content management]: /content-management/shortcodes/
[embedded shortcodes]: /shortcodes/
[GitHub]: https://github.com/gohugoio/hugo/tree/master/tpl/tplimpl/embedded/templates/shortcodes
[GitHub]: https://github.com/gohugoio/hugo/tree/master/tpl/tplimpl/embedded/templates/_shortcodes
[introduction to templating]: /templates/introduction/
[Markdown notation]: /content-management/shortcodes/#markdown-notation
[named or positional]: /content-management/shortcodes/#arguments