mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
Merge commit '5be51ac3db225d5df501ed1fa1499c41d97dbf65'
This commit is contained in:
@@ -3,14 +3,10 @@ title: Summary
|
||||
description: Returns the summary of the given page.
|
||||
categories: []
|
||||
keywords: []
|
||||
action:
|
||||
related:
|
||||
- methods/page/Truncated
|
||||
- methods/page/Content
|
||||
- methods/page/ContentWithoutSummary
|
||||
- methods/page/Description
|
||||
returnType: template.HTML
|
||||
signatures: [PAGE.Summary]
|
||||
params:
|
||||
functions_and_methods:
|
||||
returnType: template.HTML
|
||||
signatures: [PAGE.Summary]
|
||||
---
|
||||
|
||||
<!-- Do not remove the manual summary divider below. -->
|
||||
@@ -20,8 +16,6 @@ action:
|
||||
|
||||
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.
|
||||
|
||||
[summary]: /content-management/summaries/
|
||||
|
||||
To list the pages in a section with a summary beneath each link:
|
||||
|
||||
```go-html-template
|
||||
@@ -33,8 +27,6 @@ To list the pages in a section with a summary beneath each link:
|
||||
|
||||
Depending on content length and how you define the summary, the summary may be equivalent to the content itself. To determine whether the content length exceeds the summary length, use the [`Truncated`] method on a `Page` object. This is useful for conditionally rendering a “read more” link:
|
||||
|
||||
[`Truncated`]: /methods/page/truncated
|
||||
|
||||
```go-html-template
|
||||
{{ range .Pages }}
|
||||
<h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
|
||||
@@ -45,6 +37,8 @@ Depending on content length and how you define the summary, the summary may be e
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
{{% note %}}
|
||||
The `Truncated` method returns `false` if you define the summary in front matter.
|
||||
{{% /note %}}
|
||||
> [!note]
|
||||
> The `Truncated` method returns `false` if you define the summary in front matter.
|
||||
|
||||
[`Truncated`]: /methods/page/truncated
|
||||
[summary]: /content-management/summaries/
|
||||
|
Reference in New Issue
Block a user