diff --git a/_includes/components/sections/recent-posts.njk b/_includes/components/sections/recent-posts.njk index 56afddb..36c85cf 100644 --- a/_includes/components/sections/recent-posts.njk +++ b/_includes/components/sections/recent-posts.njk @@ -9,9 +9,9 @@ {% set showSummary = sectionConfig.showSummary if sectionConfig.showSummary is defined else true %} {% set primaryPosts = collections.posts if (collections and collections.posts) else [] %} {% set fallbackRecentPosts = collections.recentPosts if (collections and collections.recentPosts) else [] %} -{% set listedPosts = primaryPosts | excludeUnlistedPosts | excludeWhereNotes %} +{% set listedPosts = primaryPosts | excludeUnlistedPosts %} {% if not (listedPosts and listedPosts.length) %} - {% set listedPosts = fallbackRecentPosts | excludeUnlistedPosts | excludeWhereNotes %} + {% set listedPosts = fallbackRecentPosts | excludeUnlistedPosts %} {% endif %} {% if listedPosts and listedPosts.length %} diff --git a/_includes/components/widgets/recent-posts.njk b/_includes/components/widgets/recent-posts.njk index 0097947..82e8b0d 100644 --- a/_includes/components/widgets/recent-posts.njk +++ b/_includes/components/widgets/recent-posts.njk @@ -1,6 +1,6 @@ {# Recent Posts Widget (sidebar) - compact type-aware list #} {% set recentPosts = recentPosts or collections.recentPosts %} -{% set listedRecentPosts = recentPosts | excludeUnlistedPosts | excludeWhereNotes %} +{% set listedRecentPosts = recentPosts | excludeUnlistedPosts %} {% if listedRecentPosts and listedRecentPosts.length %}
diff --git a/eleventy.config.js b/eleventy.config.js index f975fd9..7e60213 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -913,28 +913,14 @@ export default function (eleventyConfig) { // Helper: exclude drafts from collections const isPublished = (item) => !item.data.draft; - // Helper: exclude unlisted/private/where/Loc notes from public listing surfaces + // Helper: exclude unlisted visibility from public listing surfaces const isListed = (item) => { const data = item?.data || {}; const rawVisibility = data.visibility ?? data.properties?.visibility; const visibility = Array.isArray(rawVisibility) ? rawVisibility[0] : rawVisibility; - const tags = (data.category || data.tags || []).map(t => typeof t === 'string' ? t.toLowerCase() : ''); - // Exclude unlisted, private, and where/Loc notes - if (["unlisted", "private"].includes(String(visibility ?? "").toLowerCase())) return false; - if (tags.includes("where") || tags.includes("loc")) return false; - return true; + return String(visibility ?? "").toLowerCase() !== "unlisted"; }; - // Filter: exclude where/Loc notes from collections - eleventyConfig.addFilter("excludeWhereNotes", (posts) => { - if (!Array.isArray(posts)) return []; - return posts.filter(item => { - const data = item?.data || {}; - const tags = (data.category || data.tags || []).map(t => typeof t === 'string' ? t.toLowerCase() : ''); - return !tags.includes("where") && !tags.includes("loc"); - }); - }); - // Exclude unlisted posts from UI slices like homepage/sidebar recent-post lists. eleventyConfig.addFilter("excludeUnlistedPosts", (posts) => { if (!Array.isArray(posts)) return []; diff --git a/notes.njk b/notes.njk index 53e1f8e..6f42842 100644 --- a/notes.njk +++ b/notes.njk @@ -3,7 +3,7 @@ layout: layouts/base.njk title: Notes withSidebar: true pagination: - data: collections.listedNotes | excludeWhereNotes + data: collections.listedNotes size: 20 alias: paginatedNotes generatePageOnEmptyData: true