Add related content section to single page (#77)

Set `relatedPosts` to `true` in the config to enable this.
This commit is contained in:
Track3 2019-06-21 13:15:53 +08:00 committed by GitHub
parent e333628a26
commit 6cee5adc69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 43 additions and 2 deletions

View file

@ -0,0 +1,11 @@
{{- $related := .Site.RegularPages.Related . | first 5 }}
{{ with $related }}
<div class="related-posts thin">
<h2>{{ i18n "seeAlso" }}</h2>
<ul>
{{ range . }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>
</div>
{{ end -}}