Showing related posts

This commit is contained in:
Igor Kulman 2018-09-30 12:52:02 +02:00
parent 1a5d075d00
commit 6e54af2e5c
No known key found for this signature in database
GPG Key ID: 9D77BAA2C356DFA2
3 changed files with 20 additions and 1 deletions

View File

@ -63,4 +63,6 @@
- id: yourWebsite
translation: "You website"
# Related posts
- id: seeAlso
translation: "See also"

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" }}

View File

@ -742,3 +742,8 @@ div.splitbox div.right {
display:inline-block;
float:left;}
}
/* Related posts */
h4.see-also {
margin-top: 20px
}