diff options
| author | Track3 <34504964+Track3@users.noreply.github.com> | 2019-06-21 13:15:53 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-06-21 13:15:53 +0800 |
| commit | 6cee5adc69ed07b38786f0ad2512c2a4faf31063 (patch) | |
| tree | dcb63feb11d0c3926dd98b1c41dbb9c93f5914de /layouts/partials/related-posts.html | |
| parent | e333628a2663020701e058da5e15ae39ffc796bf (diff) | |
| download | hermit-6cee5adc69ed07b38786f0ad2512c2a4faf31063.tar.gz | |
Add related content section to single page (#77)
Set `relatedPosts` to `true` in the config to enable this.
Diffstat (limited to 'layouts/partials/related-posts.html')
| -rw-r--r-- | layouts/partials/related-posts.html | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/layouts/partials/related-posts.html b/layouts/partials/related-posts.html new file mode 100644 index 0000000..d533bfd --- /dev/null +++ b/layouts/partials/related-posts.html @@ -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 -}} |
