From 448534799a51f962682725185d8eca832eaf6f0b Mon Sep 17 00:00:00 2001 From: svemagie <869694+svemagie@users.noreply.github.com> Date: Thu, 12 Mar 2026 12:21:52 +0100 Subject: [PATCH] fix: hide private visibility posts from overview collections Extend isListed helper to exclude both unlisted and private visibility, so "where" check-in notes (tagged where, used for /where and /been) no longer appear in listedNotes, listedPosts, or excludeUnlistedPosts. Co-Authored-By: Claude Sonnet 4.6 --- eleventy.config.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eleventy.config.js b/eleventy.config.js index 7e60213..aaa72a1 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -913,15 +913,15 @@ export default function (eleventyConfig) { // Helper: exclude drafts from collections const isPublished = (item) => !item.data.draft; - // Helper: exclude unlisted visibility from public listing surfaces + // Helper: exclude unlisted/private 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; - return String(visibility ?? "").toLowerCase() !== "unlisted"; + const visibility = String(Array.isArray(rawVisibility) ? rawVisibility[0] : (rawVisibility ?? "")).toLowerCase(); + return visibility !== "unlisted" && visibility !== "private"; }; - // Exclude unlisted posts from UI slices like homepage/sidebar recent-post lists. + // Exclude unlisted/private posts from UI slices like homepage/sidebar recent-post lists. eleventyConfig.addFilter("excludeUnlistedPosts", (posts) => { if (!Array.isArray(posts)) return []; return posts.filter(isListed);