From a1188673adf2a083e6a036094a5e085e9b8f09ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernat=20Borr=C3=A0s=20Civil?= <70479573+BernatBC@users.noreply.github.com> Date: Fri, 6 Oct 2023 22:01:45 +0300 Subject: [PATCH] Add section to feature some posts in the main page (#786) * Add working-on section * Remove more posts button in working on * Rename working-on.html to featured-posts.html * Iterate posts from config file * Remove unnecessary code in featured-posts.html --------- Co-authored-by: Emruz Hossain --- layouts/partials/sections/featured-posts.html | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 layouts/partials/sections/featured-posts.html diff --git a/layouts/partials/sections/featured-posts.html b/layouts/partials/sections/featured-posts.html new file mode 100644 index 0000000..c5e5404 --- /dev/null +++ b/layouts/partials/sections/featured-posts.html @@ -0,0 +1,23 @@ +{{ $sectionID := replace (lower .section.name) " " "-" }} +{{ if .section.id }} + {{ $sectionID = .section.id }} +{{ end }} + +
+ {{ if not (.section.hideTitle) }} +

+ {{ .section.name }}

+ {{ else }} +

+ {{ .section.name }}

+ {{ end }} +
+
+ {{ range $post := .posts}} + {{ with site.GetPage $post }} + {{ partial "cards/recent-post.html" . }} + {{ end }} + {{ end }} +
+
+