From f00eb24814c53576229a1f4991444785d7a27817 Mon Sep 17 00:00:00 2001 From: lew Date: Thu, 26 Mar 2026 15:06:40 +0000 Subject: [PATCH] feat: a changelog addition, and addition of subdomains to ?do=random --- www/public/changelog.txt | 1 + www/src/lib/consts.ts | 5 +++++ www/src/pages/index.astro | 5 ++--- www/src/pages/sitemap.txt.ts | 5 +---- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/www/public/changelog.txt b/www/public/changelog.txt index 0c4f9c3..a1b4dbe 100644 --- a/www/public/changelog.txt +++ b/www/public/changelog.txt @@ -1,3 +1,4 @@ +2026-03-26 - inline section labels, compact layout 2026-02-07 - related posts ! 2026-01-31 - text files now live at cleaner URLs (/*.txt instead of /txt/*.txt) 2026-01-23 - hello. we've got the skeleton of something here diff --git a/www/src/lib/consts.ts b/www/src/lib/consts.ts index ab413bf..a19834c 100644 --- a/www/src/lib/consts.ts +++ b/www/src/lib/consts.ts @@ -1,5 +1,10 @@ export const DEFAULT_CATEGORY = 'none'; +export const SUBDOMAINS = [ + 'https://c.wynne.rs/', + 'https://penfield.wynne.rs/', +]; + export const SECTIONS = { plaintext: 'plaintext', bookmarks: 'bookmarks', diff --git a/www/src/pages/index.astro b/www/src/pages/index.astro index 72abf9f..483af09 100644 --- a/www/src/pages/index.astro +++ b/www/src/pages/index.astro @@ -5,7 +5,7 @@ import { getApprovedEntries, type GuestbookEntry } from '../lib/db'; import { formatDate, extractDomain, formatListItem } from '../lib/format'; import { organizePostsByCategory, getSlug, enrichPostsWithDates } from '../lib/md'; import { getTxtFiles } from '../lib/txt'; -import { DEFAULT_CATEGORY, SECTIONS } from '../lib/consts'; +import { DEFAULT_CATEGORY, SECTIONS, SUBDOMAINS } from '../lib/consts'; const rawPosts = await getCollection('md'); const posts = enrichPostsWithDates(rawPosts); @@ -33,8 +33,7 @@ try { const urls = [ ...posts.map(post => ({ url: `/${getSlug(post.id)}`, date: post.dates.created.getTime() })), ...txtFiles.map(f => ({ url: `/${f.name}`, date: f.date.getTime() })), - ...bookmarksCollection.map(b => ({ url: b.data.url, date: b.data.date.getTime() })), -].sort((a, b) => b.date - a.date).map(e => e.url); +].sort((a, b) => b.date - a.date).map(e => e.url).concat(SUBDOMAINS); --- diff --git a/www/src/pages/sitemap.txt.ts b/www/src/pages/sitemap.txt.ts index 464b8ad..215d9ac 100644 --- a/www/src/pages/sitemap.txt.ts +++ b/www/src/pages/sitemap.txt.ts @@ -2,10 +2,7 @@ import { getCollection } from 'astro:content'; import type { APIContext } from 'astro'; import { getSlug } from '../lib/md'; import { getTxtFileNames } from '../lib/txt'; - -const SUBDOMAINS = [ - 'https://penfield.wynne.rs/', -]; +import { SUBDOMAINS } from '../lib/consts'; export async function GET(context: APIContext) { const site = context.site?.origin ?? 'https://wynne.rs';