Restore Recent Posts as first sidebar widget
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
{% if homepageConfig and homepageConfig.blogPostSidebar and homepageConfig.blogPostSidebar.length %}
|
{% if homepageConfig and homepageConfig.blogPostSidebar and homepageConfig.blogPostSidebar.length %}
|
||||||
{# === Data-driven mode: render configured widgets === #}
|
{# === Data-driven mode: render configured widgets === #}
|
||||||
{% for widget in homepageConfig.blogPostSidebar %}
|
{% for widget in homepageConfig.blogPostSidebar %}
|
||||||
{% if widget.type == "recent-posts" or widget.type == "recent-comments" or widget.type == "categories" or widget.type == "post-categories" %}
|
{% if widget.type == "recent-comments" or widget.type == "categories" or widget.type == "post-categories" %}
|
||||||
{# Hidden sidebar widgets by request #}
|
{# Hidden sidebar widgets by request #}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
@@ -169,6 +169,20 @@
|
|||||||
{# === Fallback: default blog post sidebar (backward compatibility) === #}
|
{# === Fallback: default blog post sidebar (backward compatibility) === #}
|
||||||
{# Each widget wrapped in collapsible container #}
|
{# Each widget wrapped in collapsible container #}
|
||||||
|
|
||||||
|
{# Recent Posts #}
|
||||||
|
{% set widgetKey = "post-fb-recent-posts" %}
|
||||||
|
<div class="widget-collapsible mb-4" x-data="{ open: localStorage.getItem('{{ widgetKey }}') !== null ? localStorage.getItem('{{ widgetKey }}') === 'true' : true }">
|
||||||
|
<div class="bg-surface-50 dark:bg-surface-800 rounded-lg border border-surface-200 dark:border-surface-700 shadow-sm overflow-hidden">
|
||||||
|
<button class="widget-header w-full p-4" @click="open = !open; localStorage.setItem('{{ widgetKey }}', open)" :aria-expanded="open ? 'true' : 'false'">
|
||||||
|
<h3 class="widget-title font-bold text-lg flex items-center gap-2">{{ icon("list", "w-5 h-5 text-surface-600 dark:text-surface-400") }} Recent Posts</h3>
|
||||||
|
<svg class="widget-chevron" :class="open && 'rotate-180'" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"/></svg>
|
||||||
|
</button>
|
||||||
|
<div x-show="open" x-transition:enter="transition ease-out duration-150" x-transition:enter-start="opacity-0" x-transition:enter-end="opacity-100" x-transition:leave="transition ease-in duration-100" x-transition:leave-start="opacity-100" x-transition:leave-end="opacity-0" x-cloak>
|
||||||
|
{% include "components/widgets/recent-posts-blog.njk" %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{# Author Card Compact #}
|
{# Author Card Compact #}
|
||||||
{% set widgetKey = "post-fb-author-card-compact" %}
|
{% set widgetKey = "post-fb-author-card-compact" %}
|
||||||
<div class="widget-collapsible mb-4" x-data="{ open: localStorage.getItem('{{ widgetKey }}') !== null ? localStorage.getItem('{{ widgetKey }}') === 'true' : true }">
|
<div class="widget-collapsible mb-4" x-data="{ open: localStorage.getItem('{{ widgetKey }}') !== null ? localStorage.getItem('{{ widgetKey }}') === 'true' : true }">
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{# CV Page Builder Sidebar — renders widgets from cvPageConfig.sidebar #}
|
{# CV Page Builder Sidebar — renders widgets from cvPageConfig.sidebar #}
|
||||||
{% if cvPageConfig.sidebar and cvPageConfig.sidebar.length %}
|
{% if cvPageConfig.sidebar and cvPageConfig.sidebar.length %}
|
||||||
{% for widget in cvPageConfig.sidebar %}
|
{% for widget in cvPageConfig.sidebar %}
|
||||||
{% if widget.type == "recent-posts" or widget.type == "recent-comments" or widget.type == "categories" or widget.type == "post-categories" %}
|
{% if widget.type == "recent-comments" or widget.type == "categories" or widget.type == "post-categories" %}
|
||||||
{# Hidden sidebar widgets by request #}
|
{# Hidden sidebar widgets by request #}
|
||||||
{% elif widget.type == "author-card" %}
|
{% elif widget.type == "author-card" %}
|
||||||
{% include "components/widgets/author-card.njk" %}
|
{% include "components/widgets/author-card.njk" %}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
{% if homepageConfig.sidebar and homepageConfig.sidebar.length %}
|
{% if homepageConfig.sidebar and homepageConfig.sidebar.length %}
|
||||||
{% for widget in homepageConfig.sidebar %}
|
{% for widget in homepageConfig.sidebar %}
|
||||||
{% if widget.type == "recent-posts" or widget.type == "recent-comments" or widget.type == "categories" or widget.type == "post-categories" %}
|
{% if widget.type == "recent-comments" or widget.type == "categories" or widget.type == "post-categories" %}
|
||||||
{# Hidden sidebar widgets by request #}
|
{# Hidden sidebar widgets by request #}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
{% if homepageConfig and homepageConfig.blogListingSidebar and homepageConfig.blogListingSidebar.length %}
|
{% if homepageConfig and homepageConfig.blogListingSidebar and homepageConfig.blogListingSidebar.length %}
|
||||||
{# === Data-driven mode: render configured widgets === #}
|
{# === Data-driven mode: render configured widgets === #}
|
||||||
{% for widget in homepageConfig.blogListingSidebar %}
|
{% for widget in homepageConfig.blogListingSidebar %}
|
||||||
{% if widget.type == "recent-posts" or widget.type == "recent-comments" or widget.type == "categories" or widget.type == "post-categories" %}
|
{% if widget.type == "recent-comments" or widget.type == "categories" or widget.type == "post-categories" %}
|
||||||
{# Hidden sidebar widgets by request #}
|
{# Hidden sidebar widgets by request #}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
@@ -158,6 +158,20 @@
|
|||||||
{# === Fallback: current hardcoded sidebar (backward compatibility) === #}
|
{# === Fallback: current hardcoded sidebar (backward compatibility) === #}
|
||||||
{# Each widget wrapped in collapsible container #}
|
{# Each widget wrapped in collapsible container #}
|
||||||
|
|
||||||
|
{# Recent Posts #}
|
||||||
|
{% set widgetKey = "listing-fb-recent-posts" %}
|
||||||
|
<div class="widget-collapsible mb-4" x-data="{ open: localStorage.getItem('{{ widgetKey }}') !== null ? localStorage.getItem('{{ widgetKey }}') === 'true' : true }">
|
||||||
|
<div class="bg-surface-50 dark:bg-surface-800 rounded-lg border border-surface-200 dark:border-surface-700 shadow-sm overflow-hidden">
|
||||||
|
<button class="widget-header w-full p-4" @click="open = !open; localStorage.setItem('{{ widgetKey }}', open)" :aria-expanded="open ? 'true' : 'false'">
|
||||||
|
<h3 class="widget-title font-bold text-lg flex items-center gap-2">{{ icon("list", "w-5 h-5 text-surface-600 dark:text-surface-400") }} Recent Posts</h3>
|
||||||
|
<svg class="widget-chevron" :class="open && 'rotate-180'" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"/></svg>
|
||||||
|
</button>
|
||||||
|
<div x-show="open" x-transition:enter="transition ease-out duration-150" x-transition:enter-start="opacity-0" x-transition:enter-end="opacity-100" x-transition:leave="transition ease-in duration-100" x-transition:leave-start="opacity-100" x-transition:leave-end="opacity-0" x-cloak>
|
||||||
|
{% include "components/widgets/recent-posts.njk" %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{# Author Card (h-card) — always shown #}
|
{# Author Card (h-card) — always shown #}
|
||||||
{% set widgetKey = "listing-fb-author-card" %}
|
{% set widgetKey = "listing-fb-author-card" %}
|
||||||
<div class="widget-collapsible mb-4" x-data="{ open: localStorage.getItem('{{ widgetKey }}') !== null ? localStorage.getItem('{{ widgetKey }}') === 'true' : true }">
|
<div class="widget-collapsible mb-4" x-data="{ open: localStorage.getItem('{{ widgetKey }}') !== null ? localStorage.getItem('{{ widgetKey }}') === 'true' : true }">
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
{% if homepageConfig and homepageConfig.blogPostSidebar and homepageConfig.blogPostSidebar.length %}
|
{% if homepageConfig and homepageConfig.blogPostSidebar and homepageConfig.blogPostSidebar.length %}
|
||||||
{# === Data-driven mode: render configured widgets === #}
|
{# === Data-driven mode: render configured widgets === #}
|
||||||
{% for widget in homepageConfig.blogPostSidebar %}
|
{% for widget in homepageConfig.blogPostSidebar %}
|
||||||
{% if widget.type == "recent-posts" or widget.type == "recent-comments" or widget.type == "categories" or widget.type == "post-categories" %}
|
{% if widget.type == "recent-comments" or widget.type == "categories" or widget.type == "post-categories" %}
|
||||||
{# Hidden sidebar widgets by request #}
|
{# Hidden sidebar widgets by request #}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
@@ -163,6 +163,20 @@
|
|||||||
{# === Fallback: default blog post sidebar (backward compatibility) === #}
|
{# === Fallback: default blog post sidebar (backward compatibility) === #}
|
||||||
{# Each widget wrapped in collapsible container #}
|
{# Each widget wrapped in collapsible container #}
|
||||||
|
|
||||||
|
{# Recent Posts #}
|
||||||
|
{% set widgetKey = "post-fb-recent-posts" %}
|
||||||
|
<div class="widget-collapsible mb-4" x-data="{ open: localStorage.getItem('{{ widgetKey }}') !== null ? localStorage.getItem('{{ widgetKey }}') === 'true' : true }">
|
||||||
|
<div class="bg-surface-50 dark:bg-surface-800 rounded-lg border border-surface-200 dark:border-surface-700 shadow-sm overflow-hidden">
|
||||||
|
<button class="widget-header w-full p-4" @click="open = !open; localStorage.setItem('{{ widgetKey }}', open)" :aria-expanded="open ? 'true' : 'false'">
|
||||||
|
<h3 class="widget-title font-bold text-lg flex items-center gap-2">{{ icon("list", "w-5 h-5 text-surface-500") }} Recent Posts</h3>
|
||||||
|
<svg class="widget-chevron" :class="open && 'rotate-180'" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"/></svg>
|
||||||
|
</button>
|
||||||
|
<div x-show="open" x-transition:enter="transition ease-out duration-150" x-transition:enter-start="opacity-0" x-transition:enter-end="opacity-100" x-transition:leave="transition ease-in duration-100" x-transition:leave-start="opacity-100" x-transition:leave-end="opacity-0" x-cloak>
|
||||||
|
{% include "components/widgets/recent-posts-blog.njk" %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{# Author Card Compact #}
|
{# Author Card Compact #}
|
||||||
{% set widgetKey = "post-fb-author-card-compact" %}
|
{% set widgetKey = "post-fb-author-card-compact" %}
|
||||||
<div class="widget-collapsible mb-4" x-data="{ open: localStorage.getItem('{{ widgetKey }}') !== null ? localStorage.getItem('{{ widgetKey }}') === 'true' : true }">
|
<div class="widget-collapsible mb-4" x-data="{ open: localStorage.getItem('{{ widgetKey }}') !== null ? localStorage.getItem('{{ widgetKey }}') === 'true' : true }">
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{# CV Page Builder Sidebar — renders widgets from cvPageConfig.sidebar #}
|
{# CV Page Builder Sidebar — renders widgets from cvPageConfig.sidebar #}
|
||||||
{% if cvPageConfig.sidebar and cvPageConfig.sidebar.length %}
|
{% if cvPageConfig.sidebar and cvPageConfig.sidebar.length %}
|
||||||
{% for widget in cvPageConfig.sidebar %}
|
{% for widget in cvPageConfig.sidebar %}
|
||||||
{% if widget.type == "recent-posts" or widget.type == "recent-comments" or widget.type == "categories" or widget.type == "post-categories" %}
|
{% if widget.type == "recent-comments" or widget.type == "categories" or widget.type == "post-categories" %}
|
||||||
{# Hidden sidebar widgets by request #}
|
{# Hidden sidebar widgets by request #}
|
||||||
{% elif widget.type == "author-card" %}
|
{% elif widget.type == "author-card" %}
|
||||||
{% include "components/widgets/author-card.njk" %}
|
{% include "components/widgets/author-card.njk" %}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
{% if homepageConfig.sidebar and homepageConfig.sidebar.length %}
|
{% if homepageConfig.sidebar and homepageConfig.sidebar.length %}
|
||||||
{% for widget in homepageConfig.sidebar %}
|
{% for widget in homepageConfig.sidebar %}
|
||||||
{% if widget.type == "recent-posts" or widget.type == "recent-comments" or widget.type == "categories" or widget.type == "post-categories" %}
|
{% if widget.type == "recent-comments" or widget.type == "categories" or widget.type == "post-categories" %}
|
||||||
{# Hidden sidebar widgets by request #}
|
{# Hidden sidebar widgets by request #}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
{% if homepageConfig and homepageConfig.blogListingSidebar and homepageConfig.blogListingSidebar.length %}
|
{% if homepageConfig and homepageConfig.blogListingSidebar and homepageConfig.blogListingSidebar.length %}
|
||||||
{# === Data-driven mode: render configured widgets === #}
|
{# === Data-driven mode: render configured widgets === #}
|
||||||
{% for widget in homepageConfig.blogListingSidebar %}
|
{% for widget in homepageConfig.blogListingSidebar %}
|
||||||
{% if widget.type == "recent-posts" or widget.type == "recent-comments" or widget.type == "categories" or widget.type == "post-categories" %}
|
{% if widget.type == "recent-comments" or widget.type == "categories" or widget.type == "post-categories" %}
|
||||||
{# Hidden sidebar widgets by request #}
|
{# Hidden sidebar widgets by request #}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
@@ -152,6 +152,20 @@
|
|||||||
{# === Fallback: current hardcoded sidebar (backward compatibility) === #}
|
{# === Fallback: current hardcoded sidebar (backward compatibility) === #}
|
||||||
{# Each widget wrapped in collapsible container #}
|
{# Each widget wrapped in collapsible container #}
|
||||||
|
|
||||||
|
{# Recent Posts #}
|
||||||
|
{% set widgetKey = "listing-fb-recent-posts" %}
|
||||||
|
<div class="widget-collapsible mb-4" x-data="{ open: localStorage.getItem('{{ widgetKey }}') !== null ? localStorage.getItem('{{ widgetKey }}') === 'true' : true }">
|
||||||
|
<div class="bg-surface-50 dark:bg-surface-800 rounded-lg border border-surface-200 dark:border-surface-700 shadow-sm overflow-hidden">
|
||||||
|
<button class="widget-header w-full p-4" @click="open = !open; localStorage.setItem('{{ widgetKey }}', open)" :aria-expanded="open ? 'true' : 'false'">
|
||||||
|
<h3 class="widget-title font-bold text-lg flex items-center gap-2">{{ icon("list", "w-5 h-5 text-surface-500") }} Recent Posts</h3>
|
||||||
|
<svg class="widget-chevron" :class="open && 'rotate-180'" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"/></svg>
|
||||||
|
</button>
|
||||||
|
<div x-show="open" x-transition:enter="transition ease-out duration-150" x-transition:enter-start="opacity-0" x-transition:enter-end="opacity-100" x-transition:leave="transition ease-in duration-100" x-transition:leave-start="opacity-100" x-transition:leave-end="opacity-0" x-cloak>
|
||||||
|
{% include "components/widgets/recent-posts.njk" %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{# Author Card (h-card) — always shown #}
|
{# Author Card (h-card) — always shown #}
|
||||||
{% set widgetKey = "listing-fb-author-card" %}
|
{% set widgetKey = "listing-fb-author-card" %}
|
||||||
<div class="widget-collapsible mb-4" x-data="{ open: localStorage.getItem('{{ widgetKey }}') !== null ? localStorage.getItem('{{ widgetKey }}') === 'true' : true }">
|
<div class="widget-collapsible mb-4" x-data="{ open: localStorage.getItem('{{ widgetKey }}') !== null ? localStorage.getItem('{{ widgetKey }}') === 'true' : true }">
|
||||||
|
|||||||
Reference in New Issue
Block a user