feat: a changelog addition, and addition of subdomains to ?do=random

This commit is contained in:
Lewis Wynne 2026-03-26 15:06:40 +00:00
parent 3b0bba0353
commit f00eb24814
4 changed files with 9 additions and 7 deletions

View file

@ -1,3 +1,4 @@
2026-03-26 - inline section labels, compact layout
2026-02-07 - related posts ! 2026-02-07 - related posts !
2026-01-31 - text files now live at cleaner URLs (/*.txt instead of /txt/*.txt) 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 2026-01-23 - hello. we've got the skeleton of something here

View file

@ -1,5 +1,10 @@
export const DEFAULT_CATEGORY = 'none'; export const DEFAULT_CATEGORY = 'none';
export const SUBDOMAINS = [
'https://c.wynne.rs/',
'https://penfield.wynne.rs/',
];
export const SECTIONS = { export const SECTIONS = {
plaintext: 'plaintext', plaintext: 'plaintext',
bookmarks: 'bookmarks', bookmarks: 'bookmarks',

View file

@ -5,7 +5,7 @@ import { getApprovedEntries, type GuestbookEntry } from '../lib/db';
import { formatDate, extractDomain, formatListItem } from '../lib/format'; import { formatDate, extractDomain, formatListItem } from '../lib/format';
import { organizePostsByCategory, getSlug, enrichPostsWithDates } from '../lib/md'; import { organizePostsByCategory, getSlug, enrichPostsWithDates } from '../lib/md';
import { getTxtFiles } from '../lib/txt'; 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 rawPosts = await getCollection('md');
const posts = enrichPostsWithDates(rawPosts); const posts = enrichPostsWithDates(rawPosts);
@ -33,8 +33,7 @@ try {
const urls = [ const urls = [
...posts.map(post => ({ url: `/${getSlug(post.id)}`, date: post.dates.created.getTime() })), ...posts.map(post => ({ url: `/${getSlug(post.id)}`, date: post.dates.created.getTime() })),
...txtFiles.map(f => ({ url: `/${f.name}`, date: f.date.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).concat(SUBDOMAINS);
].sort((a, b) => b.date - a.date).map(e => e.url);
--- ---
<Layout title="lewis m.w." isHome urls={urls}> <Layout title="lewis m.w." isHome urls={urls}>

View file

@ -2,10 +2,7 @@ import { getCollection } from 'astro:content';
import type { APIContext } from 'astro'; import type { APIContext } from 'astro';
import { getSlug } from '../lib/md'; import { getSlug } from '../lib/md';
import { getTxtFileNames } from '../lib/txt'; import { getTxtFileNames } from '../lib/txt';
import { SUBDOMAINS } from '../lib/consts';
const SUBDOMAINS = [
'https://penfield.wynne.rs/',
];
export async function GET(context: APIContext) { export async function GET(context: APIContext) {
const site = context.site?.origin ?? 'https://wynne.rs'; const site = context.site?.origin ?? 'https://wynne.rs';