From dbd967d3d808f2d5c98e8b5a1748b59d2752cf3a Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Thu, 3 Mar 2022 21:31:19 +0000 Subject: [PATCH] Hide related contents container if its empty --- .../article/components/related-contents.html | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/layouts/partials/article/components/related-contents.html b/layouts/partials/article/components/related-contents.html index 810b8e9..29cfff6 100644 --- a/layouts/partials/article/components/related-contents.html +++ b/layouts/partials/article/components/related-contents.html @@ -1,13 +1,13 @@ +{{ $related := (where (.Site.RegularPages.Related .) "Params.hidden" "!=" true) | first 5 }} +{{ with $related }} +{{ end }} \ No newline at end of file