added option to shuffle related articles at build
This commit is contained in:
parent
e7257ec518
commit
9f75eb3378
|
@ -88,6 +88,7 @@ summaryLength = 70 # number of words for article summaries
|
|||
# the bottom of the article, after the comments
|
||||
enableRelatedArticles = false
|
||||
relatedArticlesNum = 2 # how many related articles to show
|
||||
randomRelated = false # sorts related articles in random order (randomized at built time)
|
||||
|
||||
[menu]
|
||||
# these links will be added to the main navigation menu, sorted by weight
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
) "Params.tags" "intersect" .Params.tags
|
||||
) "Permalink" "ne" .Permalink
|
||||
}}
|
||||
{{ if site.Params.randomRelated | default false }}
|
||||
{{ $postsList = shuffle $postsList }}
|
||||
{{ end }}
|
||||
<div class="relatedArticlesContainer">
|
||||
<hr />
|
||||
<h2>More posts like this</h2>
|
||||
|
|
Loading…
Reference in New Issue