Merge pull request #202 from igorkulman/related-posts

Showing related posts
This commit is contained in:
Michael Romero 2018-10-26 00:44:34 -07:00 committed by GitHub
commit f5db9161c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 61 additions and 16 deletions

View file

@ -21,6 +21,18 @@
</ul>
</section>
{{ end }}
{{ if .Site.Params.showRelatedPosts }}
{{ $related := .Site.RegularPages.Related . | first 3 }}
{{ with $related }}
<h4 class="see-also">{{ i18n "seeAlso" }}</h4>
<ul>
{{ range . }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>
{{ end }}
{{ end }}
</article>
{{ if ne .Type "page" }}