diff --git a/content/en/content-management/summaries.md b/content/en/content-management/summaries.md index 174495a0c..678666e1a 100644 --- a/content/en/content-management/summaries.md +++ b/content/en/content-management/summaries.md @@ -111,3 +111,18 @@ Render the summary in a template by calling the [`Summary`] method on a `Page` o {{ end }} ``` + +## Alternative + +Instead of calling the `Summary` method on a `Page` object, use the [`strings.Truncate`] function for granular control of the summary length. For example: + +[`strings.Truncate`]: /functions/strings/truncate/ + +```go-html-template +{{ range site.RegularPages }} +

{{ .LinkTitle }}

+
+ {{ .Content | strings.Truncate 42 }} +
+{{ end }} +```