Summary
Updated on
Last site update: 8 May 2024
The rather confusingly named summary partial is called into the aside and represents each entry listed in list pages.
.Summary
is also a built in variable that:
generates summaries of content to use as a short version in summary views. Hugo docs
In this, the Blank, theme there is also a template (not a partial) named summary.html which contains the following:
1
2<article>
3 <h3><a href="{{ .Permalink }}">{{ .Title }}</a></h3>
4 <time>{{ .Date.Format "02.01.2006 15:04" }}</time>
5 {{ range .Params.tags }}
6 <a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
7 {{ end }}
8 <div>
9 {{ .Summary }}
10 {{ if .Truncated }}
11 <a href="{{ .Permalink }}">Read more...</a>
12 {{ end }}
13 </div>
14</article>
This is accessed from the list page with {{ .Render "summary" }}
on line 12:
1{{ define "main" }}
2 <main class="list-page">
3
4 {{ if or .Title .Content }}
5 <div>
6 {{ with .Title }}<h1>{{ . }}</h1>{{ end }}
7 {{ with .Content }}<div>{{ . }}</div>{{ end }}
8 </div>
9 {{ end }}
10
11 {{ range .Paginator.Pages }}
12 {{ .Render "summary" }}
13 {{ end }}
14 {{ partial "pagination.html" . }}
15 </main>
16{{ partial "sidebar.html" . }}
17{{ end }}