From 9e5c5dd24af8ea703ac2f8eaf05279ffaa09d135 Mon Sep 17 00:00:00 2001 From: ibrahimjaved12 <109785089+ibrahimjaved12@users.noreply.github.com> Date: Mon, 6 Jan 2025 12:38:37 +0500 Subject: [PATCH] Display Featured Stories (#1479) * Display featured stories * Do not show current testimonial in sidebar in Single Story page --- www/layouts/partials/home_stories.html | 3 +- www/layouts/stories/list.html | 11 ++++---- www/layouts/stories/single.html | 39 +++++++++++++++----------- 3 files changed, 31 insertions(+), 22 deletions(-) diff --git a/www/layouts/partials/home_stories.html b/www/layouts/partials/home_stories.html index f45bbcc26..bbd129fc9 100644 --- a/www/layouts/partials/home_stories.html +++ b/www/layouts/partials/home_stories.html @@ -1,4 +1,5 @@ -{{- $stories := where .Site.RegularPages "Type" "==" "stories" -}} +{{- $featuredStories := .Site.Data.homepage.featured_stories.content | default slice -}} +{{- $stories := partial "filtered_pages" (dict "context" . "featuredPagesUid" $featuredStories) | default (where .Site.RegularPages "Type" "==" "stories") -}} {{- $storiesSection := .Site.GetPage "section" "stories" -}} {{- $breakdowns := dict "xs-sm" (dict "size" 1 "class" "d-flex d-md-none") diff --git a/www/layouts/stories/list.html b/www/layouts/stories/list.html index e2b350b34..d1bb8765b 100644 --- a/www/layouts/stories/list.html +++ b/www/layouts/stories/list.html @@ -1,14 +1,15 @@ {{ define "main" }} {{- $pages := .Site.RegularPages -}} -{{- $stories := where $pages "Type" "==" "stories" -}} +{{- $featuredStories := .Site.Data.homepage.featured_stories.content | default slice -}} +{{- $stories := partial "filtered_pages" (dict "context" . "featuredPagesUid" $featuredStories) | default (where $pages "Type" "==" "stories") -}}