hugo/docs/content/en/methods/page/Summary.md
Bjørn Erik Pedersen 5fd1e74903
Merge commit '9b0050e9aabe4be65c78ccf292a348f309d50ccd' as 'docs'
```
git subtree add --prefix=docs/ https://github.com/gohugoio/hugoDocs.git master --squash
```

Closes #11925
2024-01-27 10:48:57 +01:00

872 B

title description categories keywords action
Summary Returns the content summary of the given page.
related returnType signatures
methods/page/Truncated
methods/page/Description
template.HTML
PAGE.Summary

There are three ways to define the content 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.

To list the pages in a section with a summary beneath each link:

{{ range .Pages }}
  <h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
  {{ .Summary }}
{{ end }}