flatten monorepo, migrate off Vercel

- Remove penfield (split to own repo on Forgejo)
- Move www/ contents to root, rename to wynne.rs
- Swap @astrojs/vercel for @astrojs/node, upgrade to Astro 6
- Remove auth-astro/GitHub OAuth (TinyAuth at proxy layer)
- Remove Vercel deploy webhook
- Switch to local SQLite DB (drop Turso)
- Update generate-stats.js for new build output paths
This commit is contained in:
Lewis Wynne 2026-04-05 01:04:11 +01:00
parent f2acf36784
commit 8a9c56c3d5
52 changed files with 45 additions and 7135 deletions

View file

@ -0,0 +1,43 @@
export function initGuestbookForm() {
const form = document.getElementById('guestbook-form') as HTMLFormElement | null;
if (!form) return;
const status = document.getElementById('guestbook-status')!;
form.addEventListener('submit', async (e) => {
e.preventDefault();
status.textContent = '';
const data = new FormData(form);
const name = (data.get('name') as string).trim();
const message = (data.get('message') as string).trim();
const url = (data.get('url') as string).trim() || null;
if (!name || !message) return;
const button = form.querySelector('button')!;
button.disabled = true;
try {
const res = await fetch('/api/guestbook', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ name, message, url }),
});
if (res.ok) {
status.textContent = ' thanks! pending approval.';
form.reset();
} else if (res.status === 429) {
status.textContent = ' too many requests, try later.';
} else {
const body = await res.json().catch(() => null);
status.textContent = body?.error ? ` ${body.error}` : ' error';
}
} catch {
status.textContent = ' failed';
} finally {
button.disabled = false;
}
});
}