feat: Add option to display related posts (#300)
* Added an option to display related posts
Co-authored-by: Alexander Bilz <mail@alexbilz.com>
1 files added
3 files modified
| | |
| | | category = "categories" |
| | | series = "series" |
| | | tag = "tags" |
| | | |
| | | [related] |
| | | includeNewer = true |
| | | threshold = 80 |
| | | toLower = true |
| | | [[related.indices]] |
| | | name = 'keywords' |
| | | weight = 100 |
| | | [[related.indices]] |
| | | name = 'tags' |
| | | weight = 80 |
| | |
| | | # Read More links for truncated summaries |
| | | # readMore = true |
| | | # postSectionName = "blog" |
| | | # relatedPosts = true |
| | | # numberOfRelatedPosts = 3 |
| | | |
| | | |
| | | reversepagetitle = true # When set to 'true', the Window Title will be reversed to 'Title | Author' instead of the default 'Author | Title' |
| | | |
| | |
| | | |
| | | {{- end -}} |
| | | |
| | | {{- if (eq .Site.Params.relatedPosts true) -}} |
| | | {{- partial "related.html" . -}} |
| | | |
| | | {{- end -}} |
| | | |
| | | {{- if (eq .Params.contact true) -}} |
| | | {{- partial "contact.html" . -}} |
| | | |
| New file |
| | |
| | | {{ $related := .Site.RegularPages.Related . | first .Site.Params.numberOfRelatedPosts }} |
| | | {{ with $related }} |
| | | <h3>Related Posts</h3> |
| | | <ul> |
| | | {{ range . }} |
| | | <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li> |
| | | |
| | | {{ end }} |
| | | </ul> |
| | | |
| | | {{ end }} |