diff --git a/README.md b/README.md index f069a03..46840a4 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,7 @@ googleAnalytics = "" # Enable Google Analytics by entering your tracking id tocOpen = true # Open Table of Contents block. Optional comments = true # Enable comments for all site pages related = true # Enable Related content for single pages + relatedMax = 5 # Set the maximum number of posts that can be displayed in related block. Optional mathjax = true # Enable MathJax for all site pages mathjaxPath = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" # Specify MathJax path. Optional mathjaxConfig = "TeX-AMS-MML_HTMLorMML" # Specify MathJax config. Optional diff --git a/layouts/partials/related.html b/layouts/partials/related.html index b6c44b0..7d7403a 100644 --- a/layouts/partials/related.html +++ b/layouts/partials/related.html @@ -1,4 +1,6 @@ -{{ $related := .Site.RegularPages.Related . | first 5 }} +{{ $relatedMax := .Site.Params.relatedMax | default 5 }} +{{ $related := .Site.RegularPages.Related . | first $relatedMax }} + {{ if and ($related) (.Param "related") }}