mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
5fd1e74903
``` git subtree add --prefix=docs/ https://github.com/gohugoio/hugoDocs.git master --squash ``` Closes #11925
29 lines
872 B
Markdown
29 lines
872 B
Markdown
---
|
|
title: Summary
|
|
description: Returns the content summary of the given page.
|
|
categories: []
|
|
keywords: []
|
|
action:
|
|
related:
|
|
- methods/page/Truncated
|
|
- methods/page/Description
|
|
returnType: template.HTML
|
|
signatures: [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:
|
|
|
|
```go-html-template
|
|
{{ range .Pages }}
|
|
<h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
|
|
{{ .Summary }}
|
|
{{ end }}
|
|
```
|
|
|
|
[content summary]: /content-management/summaries
|