mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-27 22:09:53 +02:00
Merge commit 'de0df119b504a91c9e1f442b07954f366ffb2932'
This commit is contained in:
@@ -10,17 +10,11 @@ action:
|
||||
signatures: [PAGE.Truncated]
|
||||
---
|
||||
|
||||
There are three ways to define the [content summary]:
|
||||
You can define a [summary] manually, in front matter, or automatically. A manual summary takes precedence over a front matter summary, and a front matter summary takes precedence over an automatic summary.
|
||||
|
||||
1. Let Hugo create the summary based on the first 70 words. You can change the number of words by setting the `summaryLength` in your site configuration.
|
||||
2. Manually split the content with a `<--more-->` tag in Markdown. Everything before the tag is included in the summary.
|
||||
3. Create a `summary` field in front matter.
|
||||
[summary]: /content-management/summaries/
|
||||
|
||||
{{% note %}}
|
||||
The `Truncated` method returns `false` if you define the summary in front matter.
|
||||
{{% /note %}}
|
||||
|
||||
The `Truncated` method returns `true` if the content length exceeds the summary length. This is useful for rendering a "read more" link:
|
||||
The `Truncated` method returns `true` if the content length exceeds the summary length. This is useful for conditionally rendering a "read more" link:
|
||||
|
||||
```go-html-template
|
||||
{{ range .Pages }}
|
||||
@@ -32,4 +26,6 @@ The `Truncated` method returns `true` if the content length exceeds the summary
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
[content summary]: /content-management/summaries/
|
||||
{{% note %}}
|
||||
The `Truncated` method returns `false` if you define the summary in front matter.
|
||||
{{% /note %}}
|
||||
|
Reference in New Issue
Block a user