Merge commit 'de0df119b504a91c9e1f442b07954f366ffb2932'

This commit is contained in:
Bjørn Erik Pedersen
2024-11-13 11:07:57 +01:00
89 changed files with 745 additions and 856 deletions

View File

@@ -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 %}}