Implement Content Summaries / Split on index page
Posts in the index page will be automatically summarized to its first 70 words, or until a user-defined <!--more--> divider. When summarized, the "Read More" button also appears with a RelPermalink to the full post. https://gohugo.io/content-management/summaries/
This commit is contained in:
parent
dae01e12f7
commit
b469743f16
1 changed files with 6 additions and 1 deletions
|
@ -6,7 +6,12 @@
|
||||||
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||||
</h1>
|
</h1>
|
||||||
<span class="post-date">{{ .Date.Format "Mon, Jan 2, 2006" }}</span>
|
<span class="post-date">{{ .Date.Format "Mon, Jan 2, 2006" }}</span>
|
||||||
{{ .Content }}
|
{{ .Summary }}
|
||||||
|
{{ if .Truncated }}
|
||||||
|
<div class="read-more-link">
|
||||||
|
<a href="{{ .RelPermalink }}">Read More…</a>
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue