From ad7478c905e03360a11aa959519024f049c92f7a Mon Sep 17 00:00:00 2001 From: vimux Date: Thu, 15 Nov 2018 09:11:46 -0500 Subject: [PATCH] Add related param It is possible to turn on/off related content block --- README.md | 1 + layouts/partials/related.html | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2651e8e..f353961 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,7 @@ googleAnalytics = "" # Enable Google Analytics by entering your tracking id toc = true # Enable Table of Contents for all site pages tocOpen = true # Open Table of Contents block. Optional comments = true # Enable comments for all site pages + related = true # Enable Related content for single pages 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 a17cc6f..b6c44b0 100644 --- a/layouts/partials/related.html +++ b/layouts/partials/related.html @@ -1,9 +1,9 @@ {{ $related := .Site.RegularPages.Related . | first 5 }} -{{ with $related }} +{{ if and ($related) (.Param "related") }}