Truncated
Reports whether the content length exceeds the summary length.
- Syntax
- PAGE.Truncated
- Returns
- bool
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.
The Truncated method returns true if the content length exceeds the summary length. This is useful for conditionally rendering a “read more” link:
{{ range .Pages }}
<h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
{{ .Summary }}
{{ if .Truncated }}
<a href="{{ .RelPermalink }}">Read more...</a>
{{ end }}
{{ end }}If you define the summary in front matter, the Truncated method returns false. However, if the content also contains a summary divider, the Truncated method reports whether the content extends beyond the divider.
To render the content in a named scope, call Markup.Render.Summary.Truncated on a Page object.
Last updated:
November 2, 2026
:
content: Document Page.Markup and hugo.Context (96c624b05)
Improve this page