mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
Merge commit 'b3d87dd0fd746f07f9afa6e6a2969aea41da6a38'
This commit is contained in:
@@ -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]
|
||||
|
@@ -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`.
|
||||
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user