From 2a1ccbb2812aae8c5a896490cfe9be088e9752cc Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 22 Nov 2026 10:23:57 +0000 Subject: [PATCH 1/2] Add a public Notes section at /notes/ List the posts that already show the Note badge, and link the section from the header. Garden growth tabs stay as they are. Co-authored-by: Shumin --- src/components/CommandPalette.astro | 19 +++++++- src/components/Header.astro | 4 +- src/components/PostCard.astro | 4 +- src/config.ts | 1 + src/pages/index.astro | 4 +- src/pages/llms.txt.ts | 3 +- src/pages/notes/index.astro | 68 +++++++++++++++++++++++++++++ src/pages/posts/tag/[tag].astro | 6 +++ src/utils/growth.ts | 12 ++++- 9 files changed, 112 insertions(+), 9 deletions(-) create mode 100644 src/pages/notes/index.astro diff --git a/src/components/CommandPalette.astro b/src/components/CommandPalette.astro index 2beb5b9..4824e80 100644 --- a/src/components/CommandPalette.astro +++ b/src/components/CommandPalette.astro @@ -33,6 +33,13 @@ const searchIndex = [ type: 'page' as const, tags: [], })), + { + title: 'Notes', + description: 'Short notes, kept outside the garden\'s growth stages.', + url: '/notes/', + type: 'page' as const, + tags: [], + }, ]; const searchData = JSON.stringify(searchIndex); @@ -100,7 +107,17 @@ const searchData = JSON.stringify(searchIndex); - Browse all notes + Browse the garden + + + + + + + Notes diff --git a/src/components/Header.astro b/src/components/Header.astro index 0505e4b..d137c2a 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -47,6 +47,7 @@ function isActive(url: string): boolean { ? 'font-medium text-primary-900 dark:text-primary-100' : 'text-primary-600 hover:text-primary-900 dark:text-primary-400 dark:hover:text-primary-100', ]} + aria-current={isActive(item.url) ? 'page' : undefined} > {item.title} @@ -82,12 +83,13 @@ function isActive(url: string): boolean { {siteConfig.navigation.items.map((item) => ( {item.title} diff --git a/src/components/PostCard.astro b/src/components/PostCard.astro index 1814be3..a07b93f 100644 --- a/src/components/PostCard.astro +++ b/src/components/PostCard.astro @@ -9,7 +9,7 @@ import GrowthIndicator from './GrowthIndicator.astro'; import MemoryPoint from './MemoryPoint.astro'; import Tags from './Tags.astro'; import { siteConfig } from '../config'; -import { participatesInGrowth } from '../utils/growth'; +import { isNote, participatesInGrowth } from '../utils/growth'; export interface Props { post: Post; @@ -23,7 +23,7 @@ const { title, description, growth, planted, tags, icon } = post.data; // Use effective growth if provided, otherwise fall back to manual growth const displayGrowth = effectiveGrowth || growth; const showGrowth = siteConfig.garden.showGrowthStatus && participatesInGrowth(tags); -const kind = tags?.includes('notes') ? 'Note' : 'Post'; +const kind = isNote(tags) ? 'Note' : 'Post'; const plantedDate = planted.toLocaleDateString('en-US', { year: 'numeric', diff --git a/src/config.ts b/src/config.ts index 8c63bf5..afab6f9 100644 --- a/src/config.ts +++ b/src/config.ts @@ -128,6 +128,7 @@ export const siteConfig: MyceliumConfig = { navigation: { items: [ { title: 'Garden', url: '/posts/' }, + { title: 'Notes', url: '/notes/' }, { title: 'About', url: '/about/' }, ], showSocialLinks: true, diff --git a/src/pages/index.astro b/src/pages/index.astro index bd34c63..6b13b10 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -105,12 +105,12 @@ const featuredProjects = allProjects - + {recentPosts.length > 0 && (

- Recent Notes + Recent

{ pages.map((page) => line(page.data.title, url(`/${page.id}/`), page.data.description)).join('\n'), '## Optional', [ - line('All notes', url('/posts/'), 'the garden index, filterable by growth stage and tag'), + line('Garden', url('/posts/'), 'the garden index, filterable by growth stage and tag'), + line('Notes', url('/notes/'), 'notes only; posts tagged reading-notes stay in the garden'), line('RSS feed', url('/feed.xml')), line('Sitemap', url('/sitemap-index.xml')), ].join('\n'), diff --git a/src/pages/notes/index.astro b/src/pages/notes/index.astro new file mode 100644 index 0000000..8219694 --- /dev/null +++ b/src/pages/notes/index.astro @@ -0,0 +1,68 @@ +--- +/** + * Notes index. Lists posts the Note badge already marks (isNote). + * Growth filters stay on the garden. + */ + +import BaseLayout from '../../layouts/BaseLayout.astro'; +import Header from '../../components/Header.astro'; +import Footer from '../../components/Footer.astro'; +import PostCard from '../../components/PostCard.astro'; +import PostListItem from '../../components/PostListItem.astro'; +import LayoutToggle from '../../components/LayoutToggle.astro'; +import { getCollection } from 'astro:content'; +import { siteConfig } from '../../config'; +import { isNote } from '../../utils/growth'; + +const notes = (await getCollection('posts', ({ data }) => { + return import.meta.env.PROD ? !data.draft : true; +})) + .filter((post) => isNote(post.data.tags)) + .sort((a, b) => b.data.planted.valueOf() - a.data.planted.valueOf()); + +const { layout } = siteConfig.posts; +const description = 'Short notes, kept outside the garden\'s growth stages.'; +--- + + +
+ +
+
+
+

+ Notes +

+

+ {notes.length} {notes.length === 1 ? 'note' : 'notes'}, outside the growth stages +

+
+ +
+ + {notes.length > 0 ? ( + <> +
+ {notes.map((post) => ( +
+ +
+ ))} +
+
+ {notes.map((post) => ( + + ))} +
+ + ) : ( +
+

+ No notes yet. +

+
+ )} +
+ +
diff --git a/src/utils/growth.ts b/src/utils/growth.ts index 66c2676..641349b 100644 --- a/src/utils/growth.ts +++ b/src/utils/growth.ts @@ -28,11 +28,19 @@ export interface GrowthResult { reasons: string[]; } -const NOTES_TAG = 'notes'; +export const NOTES_TAG = 'notes'; + +/** + * The Note badge and the /notes/ index. + * A reading-notes tag is a normal post, not a note. + */ +export function isNote(tags?: readonly string[]): boolean { + return tags?.includes(NOTES_TAG) ?? false; +} /** Notes stay in the garden index but never receive a growth stage. */ export function participatesInGrowth(tags?: readonly string[]): boolean { - return !tags?.includes(NOTES_TAG); + return !isNote(tags); } // Thresholds for growth calculation From d4ab0aff69530fc8c8b60ac89d47afc9453a1abd Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 22 Nov 2026 10:32:02 +0000 Subject: [PATCH 2/2] Rename the notes section to Public Notes Keep /notes/ and the existing note set. Card badges still say Note. Co-authored-by: Shumin --- src/components/CommandPalette.astro | 4 ++-- src/config.ts | 2 +- src/pages/index.astro | 2 +- src/pages/llms.txt.ts | 2 +- src/pages/notes/index.astro | 4 ++-- src/pages/posts/tag/[tag].astro | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/CommandPalette.astro b/src/components/CommandPalette.astro index 4824e80..74c6546 100644 --- a/src/components/CommandPalette.astro +++ b/src/components/CommandPalette.astro @@ -34,7 +34,7 @@ const searchIndex = [ tags: [], })), { - title: 'Notes', + title: 'Public Notes', description: 'Short notes, kept outside the garden\'s growth stages.', url: '/notes/', type: 'page' as const, @@ -117,7 +117,7 @@ const searchData = JSON.stringify(searchIndex); - Notes + Public Notes
diff --git a/src/config.ts b/src/config.ts index afab6f9..c5e35fc 100644 --- a/src/config.ts +++ b/src/config.ts @@ -128,7 +128,7 @@ export const siteConfig: MyceliumConfig = { navigation: { items: [ { title: 'Garden', url: '/posts/' }, - { title: 'Notes', url: '/notes/' }, + { title: 'Public Notes', url: '/notes/' }, { title: 'About', url: '/about/' }, ], showSocialLinks: true, diff --git a/src/pages/index.astro b/src/pages/index.astro index 6b13b10..5cebf9f 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -105,7 +105,7 @@ const featuredProjects = allProjects
- + {recentPosts.length > 0 && (
diff --git a/src/pages/llms.txt.ts b/src/pages/llms.txt.ts index cf63faa..95c3f6d 100644 --- a/src/pages/llms.txt.ts +++ b/src/pages/llms.txt.ts @@ -38,7 +38,7 @@ export const GET: APIRoute = async ({ site }) => { '## Optional', [ line('Garden', url('/posts/'), 'the garden index, filterable by growth stage and tag'), - line('Notes', url('/notes/'), 'notes only; posts tagged reading-notes stay in the garden'), + line('Public Notes', url('/notes/'), 'notes only; posts tagged reading-notes stay in the garden'), line('RSS feed', url('/feed.xml')), line('Sitemap', url('/sitemap-index.xml')), ].join('\n'), diff --git a/src/pages/notes/index.astro b/src/pages/notes/index.astro index 8219694..d9ff289 100644 --- a/src/pages/notes/index.astro +++ b/src/pages/notes/index.astro @@ -24,14 +24,14 @@ const { layout } = siteConfig.posts; const description = 'Short notes, kept outside the garden\'s growth stages.'; --- - +

- Notes + Public Notes

{notes.length} {notes.length === 1 ? 'note' : 'notes'}, outside the growth stages diff --git a/src/pages/posts/tag/[tag].astro b/src/pages/posts/tag/[tag].astro index 8b41642..5e4d6e5 100644 --- a/src/pages/posts/tag/[tag].astro +++ b/src/pages/posts/tag/[tag].astro @@ -42,7 +42,7 @@ const { tag, posts } = Astro.props;

{tag === NOTES_TAG && (

- Also listed on the Notes page. + Also listed on the Public Notes page.

)}