mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Merge commit '8b9803425e63e1b1801f8d5d676e96368d706722'
This commit is contained in:
@@ -7,7 +7,7 @@ cascade:
|
||||
---
|
||||
|
||||
<!--
|
||||
Files within this headless branch bundle are markdown snippets. Each file must contain front matter delimiters, though front matter fields are not required.
|
||||
Files within this headless branch bundle are Markdown snippets. Each file must contain front matter delimiters, though front matter fields are not required.
|
||||
|
||||
Include the rendered content using the "include" shortcode.
|
||||
-->
|
||||
|
@@ -48,8 +48,8 @@ Use with the [`template`] function:
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
[`block`]: /functions/go-template/block
|
||||
[`template`]: /functions/go-template/block
|
||||
[`block`]: /functions/go-template/block/
|
||||
[`template`]: /functions/go-template/block/
|
||||
[`partial`]: /functions/partials/include/
|
||||
|
||||
{{% include "functions/go-template/_common/text-template.md" %}}
|
||||
|
@@ -64,6 +64,6 @@ Use `else if` to check multiple conditions.
|
||||
|
||||
{{% include "functions/go-template/_common/text-template.md" %}}
|
||||
|
||||
[`if`]: /functions/go-template/if
|
||||
[`with`]: /functions/go-template/with
|
||||
[`range`]: /functions/go-template/range
|
||||
[`if`]: /functions/go-template/if/
|
||||
[`with`]: /functions/go-template/with/
|
||||
[`range`]: /functions/go-template/range/
|
||||
|
@@ -58,8 +58,8 @@ Use with the [`define`] statement:
|
||||
|
||||
{{% include "functions/go-template/_common/text-template.md" %}}
|
||||
|
||||
[`block`]: /functions/go-template/block
|
||||
[`define`]: /functions/go-template/define
|
||||
[`if`]: /functions/go-template/if
|
||||
[`range`]: /functions/go-template/range
|
||||
[`with`]: /functions/go-template/with
|
||||
[`block`]: /functions/go-template/block/
|
||||
[`define`]: /functions/go-template/define/
|
||||
[`if`]: /functions/go-template/if/
|
||||
[`range`]: /functions/go-template/range/
|
||||
[`with`]: /functions/go-template/with/
|
||||
|
@@ -51,4 +51,4 @@ Use `else if` to check multiple conditions.
|
||||
|
||||
{{% include "functions/go-template/_common/text-template.md" %}}
|
||||
|
||||
[`else`]: /functions/go-template/else
|
||||
[`else`]: /functions/go-template/else/
|
||||
|
@@ -75,7 +75,7 @@ This template will render the page title three times:
|
||||
Gaining a thorough understanding of context is critical for anyone writing template code.
|
||||
{{% /note %}}
|
||||
|
||||
[`seq`]: functions/collections/seq/
|
||||
[`seq`]: /functions/collections/seq/
|
||||
[context]: /getting-started/glossary/#context
|
||||
|
||||
## Array or slice of scalars
|
||||
@@ -194,6 +194,6 @@ Unlike ranging over an array or slice, Hugo sorts by key when ranging over a map
|
||||
|
||||
{{% include "functions/go-template/_common/text-template.md" %}}
|
||||
|
||||
[`else`]: /functions/go-template/else
|
||||
[`break`]: /functions/go-template/break
|
||||
[`continue`]: /functions/go-template/continue
|
||||
[`else`]: /functions/go-template/else/
|
||||
[`break`]: /functions/go-template/break/
|
||||
[`continue`]: /functions/go-template/continue/
|
||||
|
@@ -80,7 +80,7 @@ See additional examples in the [partial templates] section.
|
||||
## Usage
|
||||
|
||||
{{% note %}}
|
||||
Unlike `return` statements in other languages, Hugo executes the first occurrence of the `return` statement regardless of its position within logical blocks
|
||||
Unlike `return` statements in other languages, Hugo executes the first occurrence of the `return` statement regardless of its position within logical blocks.
|
||||
{{% /note %}}
|
||||
|
||||
A partial that returns a value must contain only one `return` statement, placed at the end of the template.
|
||||
|
@@ -13,7 +13,7 @@ action:
|
||||
signatures: ['template NAME [CONTEXT]']
|
||||
---
|
||||
|
||||
Use the `template` function to execute [internal templates]. For example:
|
||||
Use the `template` function to execute [embedded templates]. For example:
|
||||
|
||||
```go-html-template
|
||||
{{ range (.Paginate .Pages).Pages }}
|
||||
@@ -46,4 +46,4 @@ The example above can be rewritten using an [inline partial] template:
|
||||
|
||||
[`partial`]: /functions/partials/include/
|
||||
[inline partial]: /templates/partials/#inline-partials
|
||||
[internal templates]: /templates/internal
|
||||
[embedded templates]: /templates/embedded/
|
||||
|
@@ -84,4 +84,4 @@ Gaining a thorough understanding of context is critical for anyone writing templ
|
||||
|
||||
{{% include "functions/go-template/_common/text-template.md" %}}
|
||||
|
||||
[`else`]: /functions/go-template/else
|
||||
[`else`]: /functions/go-template/else/
|
||||
|
Reference in New Issue
Block a user