From 5300e5a423cc6e87c1e1634188ca43a3277064f1 Mon Sep 17 00:00:00 2001 From: Michael Uloth Date: Sun, 22 Dec 2024 13:46:28 -0500 Subject: [PATCH 01/23] header: highlight "notes" when on a bookmark page --- src/components/Header.astro | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/Header.astro b/src/components/Header.astro index db9c987f..d2d1842b 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -5,10 +5,12 @@ import { isPathnameInCollection } from '../utils/collections' import { getPosts } from '../utils/posts' import { getNotes } from '../utils/notes' import { getTILs } from '../utils/tils' +import { getBookmarks } from '../utils/bookmarks' const posts = await getPosts() -const notes = await getNotes() const tils = await getTILs() +const notes = await getNotes() +const bookmarks = await getBookmarks() const { pathname } = Astro.url @@ -16,8 +18,9 @@ const { pathname } = Astro.url const isCurrentPage = (item: NavItem): boolean => item.url === pathname || (isPathnameInCollection(pathname, posts) && item.url === '/') || + (isPathnameInCollection(pathname, tils) && item.url === '/til/') || (isPathnameInCollection(pathname, notes) && item.url === '/notes/') || - (isPathnameInCollection(pathname, tils) && item.url === '/til/') + (isPathnameInCollection(pathname, bookmarks) && item.url === '/notes/') ---
From fadedfeadddde7ac3f1e8941fe31c8e87b405574 Mon Sep 17 00:00:00 2001 From: Michael Uloth Date: Sun, 22 Dec 2024 13:46:45 -0500 Subject: [PATCH 02/23] comments: only show on post pages --- src/layouts/Writing.astro | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/layouts/Writing.astro b/src/layouts/Writing.astro index 022981d8..f0b01d02 100644 --- a/src/layouts/Writing.astro +++ b/src/layouts/Writing.astro @@ -106,8 +106,7 @@ const isDraft = isPathnameInCollection(pathname, drafts) } { - ( - // isPathnameInCollection(pathname, posts) && ( + isPathnameInCollection(pathname, posts) && (