Revert "fix: hide private and where/Loc notes from public overviews and collections"

This reverts commit f04c48e3cb.
This commit is contained in:
svemagie
2026-03-12 12:01:13 +01:00
parent 5099455313
commit 9088f3b01d
4 changed files with 6 additions and 20 deletions

View File

@@ -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 %}

View File

@@ -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 %}
<is-land on:visible>
<div class="widget">

View File

@@ -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 [];

View File

@@ -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