From 8b85e7c51f795532c520e3f937de26c837498c79 Mon Sep 17 00:00:00 2001 From: Gabriele Musco Date: Wed, 14 Apr 2021 07:23:25 +0200 Subject: [PATCH] hide featured articles container if disabled, made featured articles into a partial --- layouts/index.html | 25 +-------------------- layouts/partials/featured_articles.html | 29 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 24 deletions(-) create mode 100644 layouts/partials/featured_articles.html diff --git a/layouts/index.html b/layouts/index.html index 3ce65d0..0873660 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -8,32 +8,9 @@ {{ if .Site.Params.enableFeatured | default false }} {{ $featuredPostsList = where $allPostsList "Params.featured" true }} {{ $postsList = union (where $allPostsList "Params.featured" false) (where $allPostsList "Params.featured" nil) }} + {{- partial "featured_articles.html" $featuredPostsList -}} {{ end }} - - {{/* pagination */}}
{{ range (.Paginate $postsList).Pages }} diff --git a/layouts/partials/featured_articles.html b/layouts/partials/featured_articles.html new file mode 100644 index 0000000..347eeb7 --- /dev/null +++ b/layouts/partials/featured_articles.html @@ -0,0 +1,29 @@ +