diff --git a/README.md b/README.md index 33aface..f971390 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/layouts/partials/related_articles.html b/layouts/partials/related_articles.html index 583db48..71515be 100644 --- a/layouts/partials/related_articles.html +++ b/layouts/partials/related_articles.html @@ -6,6 +6,9 @@ ) "Params.tags" "intersect" .Params.tags ) "Permalink" "ne" .Permalink }} + {{ if site.Params.randomRelated | default false }} + {{ $postsList = shuffle $postsList }} + {{ end }}