spaghet fb8e42f632 refactor: consolidate blog and project filtering into shared component
The /blog and /projects listings previously used byte-identical copies of the same
filtering island, which meant bugs like inconsistent AND-vs-OR tag semantics,
duplicate-case tags, and a missing empty state were duplicated across both.

This commit introduces `FilteredList`, a single shared Solid component that:

- Unifies tag, keyword, and sort filtering for both collections
- Seeds initial filter state from the SSR request URL to avoid hydration mismatches
- Syncs active filters into the address bar via `history.replaceState` so filtered
  views survive refreshes and can be shared
- Restores filters on browser back/forward navigation (`popstate`)
- Case-folds and dedupes tags when parsing URL params

Filter logic (collectTags, filterEntries, sortKeys, URL param encoding) is extracted
into `src/lib/filters.ts` with full unit test coverage.
2026-11-12 22:38:58 -05:00
2025-08-13 00:17:00 -04:00
2025-08-13 00:17:00 -04:00
2025-08-13 00:17:00 -04:00

Spaghet.io

Welcome to my personal website! This site showcases my projects, blog posts, and professional experience. It's built with Astro and hosted using a modern deployment pipeline.

Deployment Pipeline

My website follows a robust deployment workflow:

  1. Development: I develop content and code locally using Gitea as my Git hosting solution
  2. Auto-push: Changes are automatically pushed from Gitea to GitHub via configured webhooks
  3. Hosting: The site is hosted on self-hosted infrastructure, which provides a scalable and secure hosting environment
  4. Delivery: NGINX reverse proxy handles routing and serves content with optimal performance

This pipeline ensures that my website is always up-to-date with the latest changes while leveraging modern hosting technologies.

Site Components

This website is built using Astro with the following key components:

  • Blog: Articles about technology, development, and personal insights
  • Projects: Showcasing my various projects and contributions
  • Work Experience: Professional background and career history
  • Legal: Privacy policy and terms of service
  • System status: The footer light is powered by Uptime Kuma (see below)

The "All systems normal" light in the footer reflects the public Uptime Kuma status page at uptime.spaghet.io/status/public.

  • src/lib/status.ts fetches Uptime Kuma's public status-page and heartbeat APIs server-side, reduces them to one state (up, degraded, down, maintenance, unknown) and caches the result in-process.
  • src/pages/api/status.ts exposes that small snapshot to the browser. Uptime Kuma sends no CORS headers outside dev mode and its heartbeat payload is ~200 KB, so the browser never talks to it directly.
  • src/components/SystemStatus.astro renders the light server-side (correct on first paint and with JS disabled) and then refreshes it every minute, pausing while the tab is hidden.

Optional environment variables (all have working defaults):

Variable Default Purpose
STATUS_PAGE_URL https://uptime.spaghet.io Uptime Kuma origin
STATUS_PAGE_SLUG public Status page slug
STATUS_WATCH_GROUPS (all groups) Comma-separated group names that drive the light, e.g. "Critical Services,Database Services"
STATUS_CACHE_TTL_SECONDS 60 Server-side cache lifetime
STATUS_TIMEOUT_SECONDS 4 Upstream request timeout
STATUS_STALE_AFTER_SECONDS 900 Treat the light as unknown once beats stop arriving

Theme and Colour Tokens

The site has one colour system, in src/styles/global.css. Components never hard-code a hex and, in almost every case, never need a dark: colour variant.

  • @theme declares semantic tokens (page, surface, wash, ink, ink-muted, accent, link, link-hover, edge, line, chip, chip-ink, code-bg, focus, status-*). Tailwind generates bg-page, text-ink, border-edge, … from them.
  • html.dark re-declares the same names with cooked-longer values. Because Tailwind emits the utilities as var(--color-*) references, flipping the class on <html> recolours the whole site from the same class list.
  • --color-spaghetti-*, --color-marinara*, --color-meatball*, --color-parmesan are the raw ingredient palette. They feed the hero sky and gradients; they are not for text, because the pastels fall to 1.1–1.5:1 on the cream plate.

Rules that keep it from drifting again:

  1. Add a token, don't add a dark: variant. A component class list should read the same in both modes.
  2. Keep colour rules inside @layer. Unlayered CSS outranks every Tailwind layer, which is how .dark .text-spaghetti-brown used to silently beat dark: utilities and put cream-on-cream text on the hero button (1.18:1).
  3. Never target a Tailwind utility class (e.g. .border-black/15) with an unlayered override — it fires in both modes.
  4. Prose colours go through --tw-prose-* only. The html .prose prefix in global.css is load-bearing: the typography plugin emits its defaults into the same layer but later, so at equal specificity it would win and articles would render slate.

Contrast is held to WCAG AA: 4.5:1 for body text and links, 3:1 for large text and interactive borders. Light mode is a warm cream plate with white cards; dark mode is a warm espresso plate (#140C08) with raised cards, so the marinara-and-meatball night sky has something warm to sit on.

Code blocks use dual Shiki themes (light-plus / everforest-dark, chosen by measuring every bundled theme's tokens against the site's own code backgrounds) with the --shiki-light / --shiki-dark swap in global.css.

Technologies Used

  • Framework: Astro (Static site generation)
  • Styling: Tailwind CSS
  • TypeScript: Type-safe development
  • Deployment: Gitea → GitHub → Self-hosted infrastructure → NGINX reverse proxy

Getting Started

To run this site locally:

# Install dependencies
npm install

# Start development server
npm run dev

For more information about the Astro framework and its features, please refer to the Astro documentation.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Languages
TypeScript 48.9%
Astro 33.5%
CSS 12.1%
JavaScript 5.5%