From: philgs Date: Mon, 5 Jan 2015 11:15:49 +0000 (-0500) Subject: Add example code to Summaries X-Git-Tag: v0.13~217 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e6c27f76;p=brevno-suite%2Fhugo Add example code to Summaries I was initially confused about how to use summaries. The only example code I found in the docs was on the page for list nodes, but that uses `Render "summary"`, which is for views, not an article summary. I thought a little example here might clarify the issue for future users. --- diff --git a/docs/content/content/summaries.md b/docs/content/content/summaries.md index 35acaadd..01179e2a 100644 --- a/docs/content/content/summaries.md +++ b/docs/content/content/summaries.md @@ -29,3 +29,14 @@ If the summary content divider exists within a piece of content, Hugo will split When using user-defined summaries, <!--more-->, Hugo will preserve the HTML in the summary. The summary content divider only applies to the content that it appears in. + +## Showing Summaries + +You can show content summaries with the following code. You could do this, for example, on a [list](/templates/list/) node. + + {{ range first 10 .Data.Pages }} +
+

{{ .Title }}

+ {{ .Summary }} +
+ {{ end }}