23 Commits
Author SHA1 Message Date
spaghet d7b8a351c1 fix: update build and test scripts to set Rayon and Tokio worker threads 2026-11-13 01:43:07 -05:00
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
spaghet 9e157a4fa3 feat(theme): implement dual light/dark colour token system with WCAG AA contrast
Replace hard-coded hex values and ad-hoc `dark:` variants with a single
semantic token layer in `src/styles/global.css` (`@theme` + `html.dark`
re-declaration), so every component uses the same Tailwind class list in
both modes.

Key changes:
- Define semantic tokens (page, surface, ink, accent, edge, etc.) and raw
  ingredient palette (--color-spaghetti-*, --color-marinara*, etc.)
- Configure dual Shiki themes (light-plus / everforest-dark) with
  `defaultColor: false` for proper per-mode code block colours, replacing
  the old `.prose pre { #1f2937 !important }` hack
- Tint background particles to match the warm cream/espresso palette
  instead of pure black dots
- Document theme rules: add tokens not `dark:` variants, keep colour rules
  inside `@layer`, never target Tailwind utility classes with unlayered
  overrides, route prose colours through `--tw-prose-*` only

All text and interactive elements meet WCAG AA contrast (4.5:1 body, 3:1
large/interactive). Light mode is a warm cream plate with white cards; dark
mode is espresso (#140C08) with raised cards.
2026-11-12 20:48:10 -05:00
spaghet 8b6be36f7a feat(theme): implement semantic colour token system with dark mode support 2026-11-12 20:47:51 -05:00
spaghet 9ddbad4674 feat(header): add resume button and SVG icon 2026-11-11 20:40:25 -05:00
spaghet 480259a4eb feat(status): add system status footer powered by Uptime Kuma
Replace the static "All systems normal" indicator in the Footer with a dynamic SystemStatus component backed by an internal API route and a server-side fetch of Uptime Kuma's public status/heartbeat endpoints. The light is rendered on first paint (correct without JS) and refreshed every minute, pausing when the tab is hidden.

- src/lib/status.ts: fetches and reduces Uptime Kuma data to one state
  (up/degraded/down/maintenance/unknown), with in-process caching and stale detection
- src/pages/api/status.ts: exposes a small snapshot to the browser, avoiding CORS issues and the ~200 KB heartbeat payload
- src/components/SystemStatus.astro: renders the light server-side and keeps it current client-side
- README.md: documents the feature and optional environment variables (STATUS_PAGE_URL, STATUS_PAGE_SLUG, STATUS_WATCH_GROUPS, STATUS_CACHE_TTL_SECONDS, STATUS_TIMEOUT_SECONDS, STATUS_STALE_AFTER_SECONDS)
- Tests for the summarization logic covering outage, degraded, and maintenance scenarios
2026-11-05 16:51:46 -05:00
spaghet ab6cd7c162 Refactor components and add tests for improved functionality and coverage 2026-11-04 22:16:17 -05:00
spaghet bbb76eaa31 feat(theme): replace meteor and star visuals with Italian night sky
- Update star background colors to warmer cream tones matching the food palette
- Convert meteors into meatballs with randomized sauce variants, trail/ball/splatter layers, and responsive sizing via CSS variables
- Rename and restyle twinkling stars as parmesan flecks, updating IDs and docs for visual consistency
2026-11-04 14:25:02 -05:00
spaghet 6de79d25e4 refactor(src): rename meteor and star components to food-themed names
Rename MeteorShower.astro to MeatballShower.astro and TwinklingStars.astro to ParmesanFlecks.astro to align component names with the project's meatball/parmesan visual theme.
2026-11-04 14:24:09 -05:00
spaghet 3fef5d378e chore(deps): upgrade tailwind to v4 via vite plugin
Replace @astrojs/tailwind with @tailwindcss/vite in the Astro config and lockfile to adopt Tailwind CSS v4 and simplify the build setup. Also update Markdown site content with current SpaghetAI/MarvinBlade infrastructure details.
2026-11-04 12:31:58 -05:00
spaghet ac545c4668 chore: migrate hosting documentation from Appwrite to self-hosted
Update README.md and astro.config.mjs to reflect the migration from
Appwrite to self-hosted infrastructure. Remove Appwrite-specific
environment variable schema from Astro config. Add .clinerules and
.cline to .gitignore.
2026-10-15 14:32:15 -04:00
spaghet d86f78fead Adding missing font files 2025-09-12 11:34:14 -04:00
spaghet 7d3ba2337b Merge pull request 'Refactor content handling to use Appwrite service instead of Astro collections, remove ViewTransitions import, update test files accordingly' (#2) from dev into main
Reviewed-on: #2
2025-08-23 20:11:35 -04:00
Spaghet c9948befaf Refactor content handling to use Appwrite service instead of Astro collections, remove ViewTransitions import, update test files accordingly 2025-08-23 20:10:43 -04:00
spaghet 00a4ef96f6 Merge pull request 'Complete Appwrite Migration and Feature Enhancements' (#1) from dev into main
Reviewed-on: #1
2025-08-23 00:24:29 -04:00
Spaghet 9cc9768121 Update color scheme to spaghetti palette across article layout and work page components 2025-08-22 22:11:29 -04:00
Spaghet 73db6d2cd3 Migrate Astro to latest version and update dependencies
- Updated Astro core package and related integrations to latest versions
- Added environment variable configuration in astro.config.mjs
- Removed deprecated migration plan and favicon.svg files
- Updated Search component to use onCleanup for proper effect cleanup
- Updated Appwrite service integration and configuration
- Removed old migration documentation and scripts
2025-08-22 21:54:30 -04:00
spaghet e5ce8e4783 Improve search functionality with better error handling and form submission 2025-08-22 12:50:17 -04:00
Spaghet 6ab3254384 refactor: Reorganize project structure and update dependencies
- Removed blog, project, and work content files
- Updated package dependencies including npm and removed license metadata
- Refactored component layouts and page routes
- Modified appwrite service for data operations
2025-08-22 00:08:32 -04:00
spaghet 7997eccb12 Refactor layouts to use Appwrite data types and implement search/pagination features 2025-08-21 13:50:56 -04:00
spaghet 03a79e2f79 Migrate content from markdown to Appwrite database
Remove static markdown file dependencies and update all pages/components to fetch data directly from Appwrite collections, while maintaining existing service functions for data retrieval and adding new CRUD operations for projects.
2025-08-19 10:59:50 -04:00
Spaghet 7e3b5b7a55 Appwrite migration WIP 2025-08-16 19:52:14 -04:00
SpaghetGaming 89c5e065de Starting infrastructure for server side image loading 2025-08-14 16:06:25 -04:00
102 changed files with 7794 additions and 12561 deletions

No files matched your search

-23
View File
@@ -1,23 +0,0 @@
# Node.js related
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-store/
# Build output
dist/
.astro/
# Git related
.git/
.gitignore
# Environment variables
.env
.env.*.local
# Editor/OS specific
.DS_Store
Thumbs.db
.vscode/
+3
View File
@@ -24,3 +24,6 @@ settings.json
# macOS-specific files
.DS_Store
#Cline
.clinerules
.cline
-22
View File
@@ -1,22 +0,0 @@
FROM node:lts-alpine AS builder
# Install git if it's not already present in the base image
RUN apk add --no-cache git
WORKDIR /app
# Clone the GitHub repository
# Replace <your-username> and <your-repository> with your actual GitHub details
RUN git clone -b manual https://github.com/SpaghetGaming/Spaghet.io.git .
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
# Stage 2: Serve the static files with a lightweight web server
FROM nginx:alpine
COPY --from=builder /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
-63
View File
@@ -1,63 +0,0 @@
# Astro Migration Plan
## Overview
This document outlines the steps to upgrade Astro in this project while maintaining all existing functionality, including the Appwrite integration and security practices.
## Current State
- Astro version: 4.5.18
- Project structure is working with secure environment variable handling
- Appwrite integration properly configured with credentials in .env file
- All configuration fixes have been committed to the dev branch
## Migration Steps
### 1. Preparation
- Ensure all local changes are committed to the dev branch
- Create a backup of current working state (already done)
- Verify all tests pass before starting migration
### 2. Update Dependencies
```bash
# Update Astro core package
npm install astro@latest
# Update related packages
npm install @astrojs/mdx@latest
npm install @astrojs/tailwind@latest
npm install @astrojs/solid-js@latest
npm install @astrojs/sitemap@latest
```
### 3. Configuration Updates
- Review `astro.config.mjs` for any deprecated configurations
- Update integrations syntax if needed
- Ensure Tailwind CSS configuration remains compatible
### 4. Environment Variable Handling
- Verify `import.meta.env` usage is still valid
- Confirm Appwrite integration in `src/lib/appwrite.ts` works with new version
- Test that `.env` variables are properly loaded
### 5. Component Testing
- Test Header component with Appwrite images
- Test Footer component with Appwrite images
- Verify all other components still function correctly
### 6. Build and Deployment Verification
- Run `npm run build` to ensure successful compilation
- Test locally with `npm run preview`
- Verify all images load properly from Appwrite storage
## Security Considerations
- All environment variables remain in `.env` file
- No changes to how sensitive credentials are handled
- Migration maintains the same security practices
## Rollback Plan
If issues arise during migration:
1. Revert to previous commit: `git reset --hard HEAD~1`
2. Check that all functionality works as before
3. Investigate specific breaking changes in Astro release notes
## Timeline
Estimated time: 2-4 hours for full migration and testing
+67 -2
View File
@@ -8,7 +8,7 @@ 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 Appwrite, which provides a scalable and secure hosting environment
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.
@@ -21,13 +21,78 @@ This website is built using Astro with the following key components:
- **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)
## System Status Footer
The "All systems normal" light in the footer reflects the public Uptime Kuma
status page at [uptime.spaghet.io/status/public](https://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 → Appwrite → NGINX reverse proxy
- **Deployment**: Gitea → GitHub → Self-hosted infrastructure → NGINX reverse proxy
## Getting Started
+38 -3
View File
@@ -1,12 +1,47 @@
import { defineConfig } from "astro/config"
import mdx from "@astrojs/mdx"
import sitemap from "@astrojs/sitemap"
import tailwind from "@astrojs/tailwind"
import solidJs from "@astrojs/solid-js"
import node from "@astrojs/node"
import tailwindcss from "@tailwindcss/vite"
// https://astro.build/config
export default defineConfig({
site: "https://spaghet.io",
integrations: [mdx(), sitemap(), solidJs(), tailwind({ applyBaseStyles: false })],
output: "static"
integrations: [mdx(), sitemap(), solidJs()],
output: "server",
adapter: node({ mode: "ssr" }),
markdown: {
shikiConfig: {
// Two themes plus `defaultColor: false` makes Shiki emit every token as a
// `--shiki-light` / `--shiki-dark` pair instead of a hard-coded `color:`.
// global.css then picks one per mode, so a light-mode reader no longer
// gets a dark gray code block (the old `.prose pre { #1f2937 !important }`
// hack) and a dark-mode reader no longer gets cream-on-cream.
//
// Chosen by measuring every bundled theme's token colours against the
// site's own `code-bg` surfaces, not by eye: the previous vitesse pair
// bottomed out at 1.04:1 (light) and 1.28:1 (dark) — punctuation was
// effectively invisible. `light-plus` reaches ~3.5:1 on white and
// `everforest-dark` ~5.6:1 on the espresso block, and everforest's warm
// red/green/amber palette sits inside the pasta colours rather than
// fighting them.
themes: { light: "light-plus", dark: "everforest-dark" },
defaultColor: false,
},
},
vite: {
plugins: [tailwindcss()],
optimizeDeps: {
// Client-island deps that are not reachable from the SSR entry graph are
// discovered mid-session, which makes Vite re-optimize and bump the browserHash.
// Every already-served island module then 504s with "Outdated Optimize Dep",
// hydration aborts, and the Solid lists on /blog, /projects and /search stay
// empty. Pre-declaring them bundles them at startup so the hash never changes
// underneath a page. Keep this list in sync with the imports of every
// src/components/*.tsx island (solid-js, @lib/utils -> clsx + tailwind-merge,
// @lib/search -> fuse.js).
include: ["solid-js", "solid-js/web", "clsx", "tailwind-merge", "fuse.js"],
},
}
})
-11
View File
@@ -1,11 +0,0 @@
services:
spaghet-home:
container_name: spaghet-home
network_mode: bridge
build:
context: .
dockerfile: Dockerfile
ports:
- "4321:80"
volumes:
- .:/app
-21
View File
@@ -1,21 +0,0 @@
#!/bin/bash
echo "Starting Astro migration process..."
# Step 1: Update dependencies
echo "Updating Astro and related packages..."
npm install astro@latest
npm install @astrojs/mdx@latest
npm install @astrojs/tailwind@latest
npm install @astrojs/solid-js@latest
npm install @astrojs/sitemap@latest
# Step 2: Check for any build issues
echo "Checking if project builds correctly..."
npm run build
# Step 3: Run tests to ensure everything works
echo "Running tests..."
npm test
echo "Migration process completed. Please review any warnings or errors above."
+3788 -10335
View File
File diff suppressed because it is too large. Load diff
+31 -18
View File
@@ -3,32 +3,45 @@
"type": "module",
"version": "1.0.0",
"scripts": {
"dev": "astro dev",
"dev:network": "astro dev --host",
"start": "astro dev",
"build": "astro check && astro build",
"preview": "astro preview",
"preview:network": "astro dev --host",
"dev": "dotenv -e .env -- astro dev",
"dev:network": "dotenv -e .env -- astro dev --host",
"start": "dotenv -e .env -- astro dev",
"build": "export RAYON_NUM_THREADS=1 TOKIO_WORKER_THREADS=1; astro check && astro build",
"preview": "dotenv -e .env -- astro preview",
"preview:network": "dotenv -e .env -- astro dev --host",
"astro": "astro",
"test": "export RAYON_NUM_THREADS=1 TOKIO_WORKER_THREADS=1; vitest run",
"test:watch": "export RAYON_NUM_THREADS=1 TOKIO_WORKER_THREADS=1; vitest",
"lint": "eslint .",
"lint:fix": "eslint . --fix"
},
"dependencies": {
"@astrojs/check": "^0.5.6",
"@astrojs/mdx": "^4.3.3",
"@astrojs/rss": "^4.0.5",
"@astrojs/sitemap": "^3.5.0",
"@astrojs/solid-js": "^5.1.0",
"@astrojs/tailwind": "^6.0.2",
"@astrojs/check": "^0.9.10",
"@astrojs/mdx": "^8.0.3",
"@astrojs/node": "^11.1.7",
"@astrojs/rss": "^4.0.19",
"@astrojs/sitemap": "^3.7.4",
"@astrojs/solid-js": "^7.0.2",
"@solidjs/testing-library": "^0.8.10",
"@tailwindcss/typography": "^0.5.10",
"appwrite": "^18.2.0",
"astro": "^5.13.0",
"@tailwindcss/vite": "^4.3.3",
"astro": "^7.3.8",
"clsx": "^2.1.0",
"fuse.js": "^7.0.0",
"sharp": "^0.33.2",
"notenv": "^2.0.3",
"rehype-stringify": "^10.0.1",
"remark": "^15.0.1",
"remark-rehype": "^11.1.2",
"sharp": "^0.35.5",
"solid-js": "^1.8.15",
"tailwind-merge": "^2.2.1",
"tailwindcss": "^3.4.1",
"typescript": "^5.3.3"
"tailwind-merge": "^3.7.0",
"tailwindcss": "^4.0.0",
"ts-node": "^10.9.2",
"typescript": "^6.0.3",
"vite": "^8.3.4",
"vitest": "^5.0.4"
},
"devDependencies": {
"dotenv-cli": "^10.0.0"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.
Binary file not shown.
+8 -4
View File
@@ -1,16 +1,20 @@
// Light-mode "particles" are grains of parmesan over the cream plate, not
// hard black dots: #000 at 1-2px reads as dirt and fights the pasta palette.
// Tinted with the ink token's hue and kept low-contrast on purpose.
function generateParticles(n) {
let value = `${getRandom(2560)}px ${getRandom(2560)}px #000`;
let value = `${getRandom(2560)}px ${getRandom(2560)}px #C9B49B`;
for (let i = 2; i <= n; i++) {
value += `, ${getRandom(2560)}px ${getRandom(2560)}px #000`;
value += `, ${getRandom(2560)}px ${getRandom(2560)}px #C9B49B`;
}
return value;
}
// Dark-mode stars: parmesan and cream over espresso (#140C08), not pure black.
function generateStars(n) {
let value = `${getRandom(2560)}px ${getRandom(2560)}px #fff`;
let value = `${getRandom(2560)}px ${getRandom(2560)}px #FFF6E5`;
for (let i = 2; i <= n; i++) {
value += `, ${getRandom(2560)}px ${getRandom(2560)}px #fff`;
value += `, ${getRandom(2560)}px ${getRandom(2560)}px #F5E6D3`;
}
return value;
}
+14 -15
View File
@@ -1,9 +1,10 @@
function changeTheme() {
const element = document.documentElement
const theme = element.classList.contains("dark") ? "light" : "dark"
console.log("Changing theme to:", theme)
const css = document.createElement("style")
css.appendChild(
document.createTextNode(
`* {
@@ -16,13 +17,15 @@ function changeTheme() {
),
)
document.head.appendChild(css)
if (theme === "dark") {
element.classList.add("dark")
} else {
element.classList.remove("dark")
}
console.log("Dark class present:", element.classList.contains("dark"))
window.getComputedStyle(css).opacity
document.head.removeChild(css)
localStorage.theme = theme
@@ -50,17 +53,13 @@ function preloadTheme() {
localStorage.theme = theme
}
window.onload = () => {
function initializeThemeButtons() {
const headerThemeButton = document.getElementById("header-theme-button")
const drawerThemeButton = document.getElementById("drawer-theme-button")
headerThemeButton?.addEventListener("click", changeTheme)
drawerThemeButton?.addEventListener("click", changeTheme)
}
document.addEventListener("astro:after-swap", initializeThemeButtons)
initializeThemeButtons()
}
// Use event delegation to avoid duplicate listeners on navigation
document.addEventListener("click", (event) => {
const target = event.target.closest("#header-theme-button, #drawer-theme-button");
if (target) {
changeTheme();
}
});
document.addEventListener("astro:after-swap", preloadTheme)
+1
View File
@@ -23,5 +23,6 @@
<symbol id="tailwind" viewBox="0 0 47 40" fill="none">
<path fill="#6366f1" d="M23.5 6.5C17.5 6.5 13.75 9.5 12.25 15.5C14.5 12.5 17.125 11.375 20.125 12.125C21.8367 12.5529 23.0601 13.7947 24.4142 15.1692C26.6202 17.4084 29.1734 20 34.75 20C40.75 20 44.5 17 46 11C43.75 14 41.125 15.125 38.125 14.375C36.4133 13.9471 35.1899 12.7053 33.8357 11.3308C31.6297 9.09158 29.0766 6.5 23.5 6.5ZM12.25 20C6.25 20 2.5 23 1 29C3.25 26 5.875 24.875 8.875 25.625C10.5867 26.0529 11.8101 27.2947 13.1642 28.6693C15.3702 30.9084 17.9234 33.5 23.5 33.5C29.5 33.5 33.25 30.5 34.75 24.5C32.5 27.5 29.875 28.625 26.875 27.875C25.1633 27.4471 23.9399 26.2053 22.5858 24.8307C20.3798 22.5916 17.8266 20 12.25 20Z"/>
</symbol>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

+15
View File
@@ -74,6 +74,21 @@
<path d="M12 5l7 7-7 7"/>
</symbol>
<!-- resume (document with a folded corner and text lines) -->
<symbol id="resume" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" viewBox="0 0 24 24">
<path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"/>
<path d="M14 2v6h6"/>
<path d="M8 13h5"/>
<path d="M8 17h8"/>
</symbol>
<!-- external-link (off-site nav items, e.g. Docs) -->
<symbol id="external-link" viewBox="0 0 24 24" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5">
<path d="M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"/>
<path d="M15 3h6v6"/>
<path d="M10 14L21 3"/>
</symbol>
<!-- globe -->
<symbol id="globe" viewBox="0 0 16 16">
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.268 14.0934C11.9051 13.4838 13.2303 12.2333 13.9384 10.6469C13.1192 10.7941 12.2138 10.9111 11.2469 10.9925C11.0336 12.2005 10.695 13.2621 10.268 14.0934ZM8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16ZM8.48347 14.4823C8.32384 14.494 8.16262 14.5 8 14.5C7.83738 14.5 7.67616 14.494 7.51654 14.4823C7.5132 14.4791 7.50984 14.4759 7.50647 14.4726C7.2415 14.2165 6.94578 13.7854 6.67032 13.1558C6.41594 12.5744 6.19979 11.8714 6.04101 11.0778C6.67605 11.1088 7.33104 11.125 8 11.125C8.66896 11.125 9.32395 11.1088 9.95899 11.0778C9.80021 11.8714 9.58406 12.5744 9.32968 13.1558C9.05422 13.7854 8.7585 14.2165 8.49353 14.4726C8.49016 14.4759 8.4868 14.4791 8.48347 14.4823ZM11.4187 9.72246C12.5137 9.62096 13.5116 9.47245 14.3724 9.28806C14.4561 8.87172 14.5 8.44099 14.5 8C14.5 7.55901 14.4561 7.12828 14.3724 6.71194C13.5116 6.52755 12.5137 6.37904 11.4187 6.27753C11.4719 6.83232 11.5 7.40867 11.5 8C11.5 8.59133 11.4719 9.16768 11.4187 9.72246ZM10.1525 6.18401C10.2157 6.75982 10.25 7.36805 10.25 8C10.25 8.63195 10.2157 9.24018 10.1525 9.81598C9.46123 9.85455 8.7409 9.875 8 9.875C7.25909 9.875 6.53877 9.85455 5.84749 9.81598C5.7843 9.24018 5.75 8.63195 5.75 8C5.75 7.36805 5.7843 6.75982 5.84749 6.18401C6.53877 6.14545 7.25909 6.125 8 6.125C8.74091 6.125 9.46123 6.14545 10.1525 6.18401ZM11.2469 5.00748C12.2138 5.08891 13.1191 5.20593 13.9384 5.35306C13.2303 3.7667 11.9051 2.51622 10.268 1.90662C10.695 2.73788 11.0336 3.79953 11.2469 5.00748ZM8.48347 1.51771C8.4868 1.52089 8.49016 1.52411 8.49353 1.52737C8.7585 1.78353 9.05422 2.21456 9.32968 2.84417C9.58406 3.42562 9.80021 4.12856 9.95899 4.92219C9.32395 4.89118 8.66896 4.875 8 4.875C7.33104 4.875 6.67605 4.89118 6.04101 4.92219C6.19978 4.12856 6.41594 3.42562 6.67032 2.84417C6.94578 2.21456 7.2415 1.78353 7.50647 1.52737C7.50984 1.52411 7.51319 1.52089 7.51653 1.51771C7.67615 1.50597 7.83738 1.5 8 1.5C8.16262 1.5 8.32384 1.50597 8.48347 1.51771ZM5.73202 1.90663C4.0949 2.51622 2.76975 3.7667 2.06159 5.35306C2.88085 5.20593 3.78617 5.08891 4.75309 5.00748C4.96639 3.79953 5.30497 2.73788 5.73202 1.90663ZM4.58133 6.27753C3.48633 6.37904 2.48837 6.52755 1.62761 6.71194C1.54392 7.12828 1.5 7.55901 1.5 8C1.5 8.44099 1.54392 8.87172 1.62761 9.28806C2.48837 9.47245 3.48633 9.62096 4.58133 9.72246C4.52807 9.16768 4.5 8.59133 4.5 8C4.5 7.40867 4.52807 6.83232 4.58133 6.27753ZM4.75309 10.9925C3.78617 10.9111 2.88085 10.7941 2.06159 10.6469C2.76975 12.2333 4.0949 13.4838 5.73202 14.0934C5.30497 13.2621 4.96639 12.2005 4.75309 10.9925Z"/>

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

+21 -16
View File
@@ -1,41 +1,46 @@
import { formatDate } from "@lib/utils"
import type { CollectionEntry } from "astro:content"
import type { CardEntry } from "@lib/types"
type Props = {
entry: CollectionEntry<"blog"> | CollectionEntry<"projects">
entry: CardEntry
collection?: string
pill?: boolean
}
export default function ArrowCard({entry, pill}: Props) {
export default function ArrowCard({entry, pill, collection}: Props) {
// Search results carry their own `collection`; listing pages pass it in
// as a prop. Both paths resolve to the same route shape.
const resolvedCollection = "collection" in entry ? entry.collection : collection
const id = "slug" in entry ? entry.slug : entry.id
return (
<a href={`/${entry.collection}/${entry.slug}`} class="group p-4 gap-3 flex items-center border rounded-lg hover:bg-black/5 hover:dark:bg-white/10 border-black/15 dark:border-white/20 transition-colors duration-300 ease-in-out">
<div class="w-full group-hover:text-black group-hover:dark:text-white blend">
<a href={`/${resolvedCollection === 'blog' ? 'blog' : 'projects'}/${id}`} class="group p-4 gap-3 flex items-center border border-edge rounded-lg bg-surface hover:bg-wash transition-colors duration-300 ease-in-out">
<div class="w-full group-hover:text-link blend">
<div class="flex flex-wrap items-center gap-2">
{pill &&
<div class="text-sm capitalize px-2 py-0.5 rounded-full border border-black/15 dark:border-white/20 bg-spaghetti-yellow/20 dark:bg-spaghetti-yellow/20 text-spaghetti-brown">
{entry.collection === "blog" ? "post" : "project"}
<div class="text-sm capitalize px-2 py-0.5 rounded-full border border-line bg-chip text-chip-ink">
{collection === "blog" ? "post" : "project"}
</div>
}
<div class="text-sm uppercase">
{formatDate(entry.data.date)}
<div class="text-sm uppercase text-accent">
{formatDate(entry.date)}
</div>
</div>
<div class="font-semibold mt-3 text-spaghetti-brown">
{entry.data.title}
<div class="font-semibold mt-3 text-ink">
{entry.title}
</div>
<div class="text-sm line-clamp-2 text-spaghetti-brown">
{entry.data.summary}
<div class="text-sm line-clamp-2 text-ink-muted">
{entry.summary}
</div>
<ul class="flex flex-wrap mt-2 gap-1">
{entry.data.tags.map((tag:string) => ( // this line has an error; Parameter 'tag' implicitly has an 'any' type.ts(7006)
<li class="text-xs uppercase py-0.5 px-1 rounded bg-spaghetti-yellow/20 dark:bg-spaghetti-yellow/20 text-spaghetti-brown">
{entry.tags.map((tag:string) => (
<li class="text-xs uppercase py-0.5 px-1 rounded bg-chip text-chip-ink">
{tag}
</li>
))}
</ul>
</div>
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="stroke-current group-hover:stroke-black group-hover:dark:stroke-white">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="stroke-current group-hover:stroke-link">
<line x1="5" y1="12" x2="19" y2="12" class="scale-x-0 group-hover:scale-x-100 translate-x-4 group-hover:translate-x-1 transition-all duration-300 ease-in-out" />
<polyline points="12 5 19 12 12 19" class="translate-x-0 group-hover:translate-x-1 transition-all duration-300 ease-in-out" />
</svg>
-1
View File
@@ -1,5 +1,4 @@
---
import { ViewTransitions } from "astro:transitions"
interface Props {
title: string
-72
View File
@@ -1,72 +0,0 @@
import type { CollectionEntry } from "astro:content"
import { createEffect, createSignal, For } from "solid-js"
import ArrowCard from "@components/ArrowCard"
import { cn } from "@lib/utils"
type Props = {
tags: string[]
data: CollectionEntry<"blog">[]
}
export default function Blog({ data, tags }: Props) {
const [filter, setFilter] = createSignal(new Set<string>())
const [posts, setPosts] = createSignal<CollectionEntry<"blog">[]>([])
createEffect(() => {
setPosts(data.filter((entry) =>
Array.from(filter()).every((value) =>
entry.data.tags.some((tag:string) =>
tag.toLowerCase() === String(value).toLowerCase()
)
)
))
})
function toggleTag(tag: string) {
setFilter((prev) =>
new Set(prev.has(tag)
? [...prev].filter((t) => t !== tag)
: [...prev, tag]
)
)
}
return (
<div class="grid grid-cols-1 sm:grid-cols-3 gap-6">
<div class="col-span-3 sm:col-span-1">
<div class="sticky top-24">
<div class="text-sm font-semibold uppercase mb-2 text-spaghetti-brown">Filter</div>
<ul class="flex flex-wrap sm:flex-col gap-1.5">
<For each={tags}>
{(tag) => (
<li>
<button onClick={() => toggleTag(tag)} class={cn("w-full px-2 py-1 rounded", "whitespace-nowrap overflow-hidden overflow-ellipsis", "flex gap-2 items-center", "bg-spaghetti-yellow/20 dark:bg-spaghetti-yellow/20", "hover:bg-spaghetti-yellow/30 hover:dark:bg-spaghetti-yellow/30", "transition-colors duration-300 ease-in-out", filter().has(tag) && "text-spaghetti-brown dark:text-spaghetti-brown")}>
<svg class={cn("size-5 fill-spaghetti-brown/50 dark:fill-spaghetti-brown/50", "transition-colors duration-300 ease-in-out", filter().has(tag) && "fill-spaghetti-brown dark:fill-spaghetti-brown")}>
<use href={`/ui.svg#square`} class={cn(!filter().has(tag) ? "block" : "hidden")} />
<use href={`/ui.svg#square-check`} class={cn(filter().has(tag) ? "block" : "hidden")} />
</svg>
{tag}
</button>
</li>
)}
</For>
</ul>
</div>
</div>
<div class="col-span-3 sm:col-span-2">
<div class="flex flex-col">
<div class="text-sm uppercase mb-2">
SHOWING {posts().length} OF {data.length} POSTS
</div>
<ul class="flex flex-col gap-3">
{posts().map((post) => (
<li>
<ArrowCard entry={post} />
</li>
))}
</ul>
</div>
</div>
</div>
)
}
+2 -2
View File
@@ -7,10 +7,10 @@ function CounterButton() {
return (
<div class="flex gap-4 items-center">
<button onClick={increment} class="px-3 py-1 border border-spaghetti-yellow/50 dark:border-spaghetti-yellow/50 hover:bg-spaghetti-yellow/20 dark:hover:bg-spaghetti-yellow/20 blend text-spaghetti-brown">
<button onClick={increment} class="px-3 py-1 border border-edge hover:bg-chip hover:text-chip-ink blend text-ink">
Increment
</button>
<div class="text-spaghetti-brown">
<div class="text-ink">
Clicked {count()} {count() === 1 ? "time" : "times"}
</div>
</div>
+15 -8
View File
@@ -1,35 +1,42 @@
---
import { SITE, LINKS } from "@consts"
import { cn } from "@lib/utils"
import { SITE, LINKS, RESUME } from "@consts"
import { cn, ACTIVE_NAV_COLORS, isNavActive } from "@lib/utils"
const { pathname } = Astro.url
const subpath = pathname.match(/[^/]+/g)
---
<div id="drawer" class="fixed inset-0 h-0 z-40 overflow-hidden flex flex-col items-center justify-center md:hidden bg-spaghetti-cream dark:bg-black transition-[height] duration-300 ease-in-out">
<div id="drawer" class="fixed inset-0 h-0 z-40 overflow-hidden flex flex-col items-center justify-center md:hidden bg-page transition-[height] duration-300 ease-in-out">
<nav class="flex flex-col items-center space-y-2">
{
LINKS.map((LINK) => (
<a href={LINK.HREF} class={cn("flex items-center justify-center px-3 py-1 rounded-full", "text-current hover:text-black dark:hover:text-white", "hover:bg-spaghetti-yellow/20 dark:hover:bg-spaghetti-yellow/20", "transition-colors duration-300 ease-in-out", pathname === LINK.HREF || "/" + subpath?.[0] === LINK.HREF ? "pointer-events-none bg-spaghetti-red dark:bg-spaghetti-red text-spaghetti-brown dark:text-spaghetti-brown" : "")}>
<a href={LINK.HREF} class={cn("flex items-center justify-center px-3 py-1 rounded-full", "text-ink hover:bg-wash hover:text-link", "transition-colors duration-300 ease-in-out", isNavActive(pathname, LINK.HREF) && "pointer-events-none", isNavActive(pathname, LINK.HREF) && ACTIVE_NAV_COLORS)}>
{LINK.TEXT}
</a>
))
}
<!-- The header pill drops its label below `sm`, so the drawer is where the
Résumé CTA keeps its text on mobile. -->
<a href={RESUME.HREF} target="_blank" rel="noopener noreferrer" aria-label={`${RESUME.TEXT} for ${SITE.AUTHOR}, opens in a new tab`} class="flex items-center justify-center gap-1.5 px-3 py-1 rounded-full bg-chip text-chip-ink stroke-current border border-edge hover:bg-link hover:text-page hover:border-link transition-colors duration-300">
<svg class="size-4 shrink-0" fill="none">
<use href={`/ui.svg#${RESUME.ICON}`}></use>
</svg>
<span>{RESUME.TEXT}</span>
</a>
</nav>
<div class="flex gap-1 mt-5">
<a href="/search" aria-label={`Search blog posts and projects on ${SITE.TITLE}`} class={cn("size-9 rounded-full p-2 items-center justify-center bg-transparent hover:bg-spaghetti-yellow/20 dark:hover:bg-spaghetti-yellow/20 stroke-current hover:stroke-black hover:dark:stroke-white border border-spaghetti-yellow/50 dark:border-spaghetti-yellow/50 transition-colors duration-300 ease-in-out", pathname === "/search" || "/" + subpath?.[0] === "search" ? "pointer-events-none bg-spaghetti-red dark:bg-spaghetti-red text-white dark:text-white" : "")}>
<a href="/search" aria-label={`Search blog posts and projects on ${SITE.TITLE}`} class={cn("size-9 rounded-full p-2 items-center justify-center bg-transparent stroke-current border border-edge hover:bg-chip hover:text-chip-ink transition-colors duration-300 ease-in-out", isNavActive(pathname, "/search") && "pointer-events-none", isNavActive(pathname, "/search") && ACTIVE_NAV_COLORS)}>
<svg class="size-full">
<use href="/ui.svg#search"></use>
</svg>
</a>
<a href="/rss.xml" target="_blank" aria-label={`Rss feed for ${SITE.TITLE}`} class="size-9 rounded-full p-2 items-center justify-center bg-transparent hover:bg-spaghetti-yellow/20 dark:hover:bg-spaghetti-yellow/20 stroke-current hover:stroke-black hover:dark:stroke-white border border-spaghetti-yellow/50 dark:border-spaghetti-yellow/50 transition-colors duration-300 ease-in-out">
<a href="/rss.xml" target="_blank" aria-label={`Rss feed for ${SITE.TITLE}`} class="size-9 rounded-full p-2 items-center justify-center bg-transparent stroke-current border border-edge hover:bg-chip hover:text-chip-ink transition-colors duration-300 ease-in-out">
<svg class="size-full">
<use href="/ui.svg#rss"></use>
</svg>
</a>
<button id="drawer-theme-button" aria-label={`Toggle light and dark theme`} class="size-9 rounded-full p-2 items-center justify-center bg-transparent hover:bg-spaghetti-yellow/20 dark:hover:bg-spaghetti-yellow/20 stroke-current hover:stroke-black hover:dark:stroke-white border border-spaghetti-yellow/50 dark:border-spaghetti-yellow/50 transition-colors duration-300 ease-in-out">
<button id="drawer-theme-button" aria-label={`Toggle light and dark theme`} class="size-9 rounded-full p-2 items-center justify-center bg-transparent stroke-current border border-edge hover:bg-chip hover:text-chip-ink transition-colors duration-300 ease-in-out">
<svg class="block dark:hidden size-full">
<use href="/ui.svg#sun"></use>
</svg>
+210
View File
@@ -0,0 +1,210 @@
import { createEffect, createMemo, createSignal, onCleanup, onMount, For } from "solid-js"
import ArrowCard from "@components/ArrowCard"
import { cn } from "@lib/utils"
import {
collectTags,
filterEntries,
hasActiveFilters,
parseFilterParams,
tagCounts,
writeFilterParams,
DEFAULT_SORT,
SORT_KEYS,
SORT_LABELS,
type FilterState,
type ListEntry,
type SortKey,
} from "@lib/filters"
type Props = {
entries: ListEntry[]
collection: "blog" | "projects"
/**
* Filter state read from the incoming request URL. The island is SSR'd, so
* seeding from `window.location` would render one list on the server and a
* different one on hydration; the page passes the parsed request URL instead.
*/
initial?: FilterState
}
/**
* Shared tag + keyword + sort filter for the /blog and /projects listings.
*
* Both islands used to be byte-identical copies of each other, which is how
* the AND-vs-OR semantics, the duplicate-case tags and the missing empty state
* ended up duplicated too. One component, one place to fix.
*/
export default function FilteredList({ entries, collection, initial }: Props) {
const [filter, setFilter] = createSignal<FilterState>(
initial ?? { tags: [], query: "", sort: DEFAULT_SORT }
)
const tags = createMemo(() => collectTags(entries))
const counts = createMemo(() => tagCounts(entries, filter()))
const visible = createMemo(() => filterEntries(entries, filter()))
const filtered = createMemo(() => hasActiveFilters(filter()))
function toggleTag(key: string) {
setFilter((prev) => ({
...prev,
tags: prev.tags.includes(key)
? prev.tags.filter((tag) => tag !== key)
: [...prev.tags, key],
}))
}
function reset() {
setFilter({ tags: [], query: "", sort: DEFAULT_SORT })
}
// Mirror state into the address bar so a filtered view survives a refresh and
// can be shared, matching what the search island already does.
const syncUrl = () => {
if (typeof window === "undefined") return
const url = new URL(window.location.href)
writeFilterParams(url.searchParams, filter())
window.history.replaceState({}, "", url.toString())
}
createEffect(syncUrl)
// Restore filters when the user navigates with browser back/forward. Bound
// only in onMount: this component is SSR'd, and `window` does not exist there.
const onPopState = () =>
setFilter(parseFilterParams(new URL(window.location.href).searchParams))
let popStateBound = false
onMount(() => {
window.addEventListener("popstate", onPopState)
popStateBound = true
})
onCleanup(() => {
if (popStateBound) window.removeEventListener("popstate", onPopState)
})
const noun = collection === "blog" ? "post" : "project"
const plural = `${noun}s`
return (
<div class="grid grid-cols-1 sm:grid-cols-3 gap-6">
<div class="col-span-3 sm:col-span-1">
<div class="sticky top-24">
<div class="flex items-center justify-between gap-2">
<div class="text-sm font-semibold uppercase mb-2 text-ink">Filter</div>
{filtered() && (
<button
onClick={reset}
class="text-xs uppercase text-link hover:text-link-hover underline underline-offset-2 mb-2 transition-colors duration-300 ease-in-out"
>
Clear all
</button>
)}
</div>
<label class="block text-xs uppercase mb-1 text-ink-muted" for="filter-q">
Keyword
</label>
<input
id="filter-q"
type="search"
value={filter().query}
onInput={(e) => setFilter((prev) => ({ ...prev, query: e.currentTarget.value }))}
placeholder={`Search ${plural}…`}
autocomplete="off"
spellcheck={false}
class="w-full px-2.5 py-1.5 rounded outline-none text-ink bg-chip border border-edge focus:border-edge transition-colors duration-300 ease-in-out"
/>
<label class="block text-xs uppercase mt-3 mb-1 text-ink-muted" for="filter-sort">
Sort
</label>
<select
id="filter-sort"
value={filter().sort}
onChange={(e) => setFilter((prev) => ({ ...prev, sort: e.currentTarget.value as SortKey }))}
class="w-full px-2 py-1.5 rounded text-ink bg-chip border border-edge outline-none transition-colors duration-300 ease-in-out"
>
<For each={SORT_KEYS}>
{/* `selected` is set explicitly because `<select value>` has no
content attribute: SSR writes it as one, which browsers ignore,
so a deep link like ?sort=az would render the wrong option
selected until hydration. */}
{(key) => <option value={key} selected={filter().sort === key}>{SORT_LABELS[key]}</option>}
</For>
</select>
<div class="mt-3">
<div class="text-xs uppercase mb-1 text-ink-muted">Tags</div>
<ul role="group" aria-label="Filter by tag" class="flex flex-wrap sm:flex-col gap-1.5">
<For each={tags()}>
{(tag) => {
const selected = () => filter().tags.includes(tag.key)
const count = () => counts().get(tag.key) ?? 0
return (
<li>
<button
onClick={() => toggleTag(tag.key)}
aria-pressed={selected()}
class={cn(
"w-full px-2 py-1 rounded text-ink",
"whitespace-nowrap overflow-hidden overflow-ellipsis",
"flex gap-2 items-center",
"border border-transparent hover:border-edge hover:bg-wash",
"transition-colors duration-300 ease-in-out",
selected() && "bg-chip text-chip-ink border-chip",
count() === 0 && !selected() && "opacity-50"
)}
>
<svg class={cn("size-5 shrink-0 fill-current opacity-60", "transition-colors duration-300 ease-in-out", selected() && "opacity-100")}>
<use href={`/ui.svg#square`} class={cn(selected() ? "hidden" : "block")} />
<use href={`/ui.svg#square-check`} class={cn(selected() ? "block" : "hidden")} />
</svg>
<span class="flex-1 text-left truncate">{tag.label}</span>
<span class="text-xs tabular-nums opacity-70">{count()}</span>
</button>
</li>
)
}}
</For>
</ul>
</div>
</div>
</div>
<div class="col-span-3 sm:col-span-2">
<div class="flex flex-col">
<div class="text-sm uppercase mb-2" aria-live="polite">
SHOWING {visible().length} OF {entries.length} {plural.toUpperCase()}
</div>
{visible().length === 0 ? (
<div class="p-4 border border-edge rounded-lg bg-surface">
<div class="font-semibold text-ink">No {plural} match these filters.</div>
<div class="text-sm text-ink-muted mt-1">
Tags are combined with OR, so a keyword that excludes everything is the usual
culprit. Try shortening the keyword or clearing the filters.
</div>
<button
onClick={reset}
class="mt-3 px-2 py-1 rounded text-ink border border-edge hover:bg-wash transition-colors duration-300 ease-in-out"
>
Clear filters
</button>
</div>
) : (
<ul class="flex flex-col gap-3">
<For each={visible()}>
{(entry) => (
<li>
<ArrowCard entry={entry} collection={collection} />
</li>
)}
</For>
</ul>
)}
</div>
</div>
</div>
)
}
+19 -19
View File
@@ -1,19 +1,25 @@
---
import { SITE, SOCIALS } from "@consts"
import Container from "@components/Container.astro"
import SystemStatus from "@components/SystemStatus.astro"
import { getSystemStatus } from "@lib/status"
// Rendered server-side so the light is correct in the first paint (and with JS
// off); SystemStatus then keeps it current from /api/status.
const statusSnapshot = await getSystemStatus()
---
<footer class="relative bg-white dark:bg-black">
<footer class="relative bg-page">
<div class="animate">
<section class="py-5">
<Container size="md">
<div class="flex items-center justify-center sm:justify-end">
<button id="back-to-top" aria-label="Back to top of page" class="group flex w-fit p-1.5 gap-1.5 text-sm items-center border rounded hover:bg-black/5 hover:dark:bg-white/10 border-black/15 dark:border-white/20 transition-colors duration-300 ease-in-out">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="stroke-current group-hover:stroke-black group-hover:dark:stroke-white rotate-90">
<button id="back-to-top" aria-label="Back to top of page" class="group flex w-fit p-1.5 gap-1.5 text-sm items-center border rounded border-edge hover:bg-chip hover:text-chip-ink transition-colors duration-300 ease-in-out">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="stroke-current rotate-90">
<line x1="19" y1="12" x2="5" y2="12" class="scale-x-0 group-hover:scale-x-100 translate-x-3 group-hover:translate-x-0 transition-all duration-300 ease-in-out" />
<polyline points="12 19 5 12 12 5" class="translate-x-1 group-hover:translate-x-0 transition-all duration-300 ease-in-out" />
</svg>
<div class="w-full group-hover:text-black group-hover:dark:text-white transition-colors duration-300 ease-in-out">
<div class="w-full transition-colors duration-300 ease-in-out">
Back to top
</div>
</button>
@@ -21,39 +27,33 @@ import Container from "@components/Container.astro"
</Container>
</section>
<section class=" py-5 overflow-hidden whitespace-nowrap border-t border-black/10 dark:border-white/25">
<section class=" py-5 overflow-hidden whitespace-nowrap border-t border-line">
<Container size="md">
<div class="grid grid-cols-1 sm:grid-cols-2 gap-3">
<div class="flex flex-col items-center sm:items-start">
<a href="/" class="flex gap-1 w-fit font-semibold text-current hover:text-black dark:hover:text-white transition-colors duration-300 ease-in-out">
<a href="/" class="flex gap-1 w-fit font-semibold text-ink transition-colors duration-300 ease-in-out hover:text-link">
<img src="/images/logo.png" alt="Logo" class="size-6" />
{SITE.TITLE}
</a>
</div>
<div class="flex gap-2 justify-center sm:justify-end items-center">
<span class="relative flex h-3 w-3">
<span class="animate-ping absolute inline-flex h-full w-full rounded-full bg-green-300"></span>
<span class="relative inline-flex rounded-full h-3 w-3 bg-green-500"></span>
</span>
All systems normal
</div>
<SystemStatus snapshot={statusSnapshot} />
</div>
</Container>
</section>
<section class=" py-5 overflow-hidden whitespace-nowrap border-t border-black/10 dark:border-white/25">
<section class=" py-5 overflow-hidden whitespace-nowrap border-t border-line">
<Container size="md">
<div class="h-full grid grid-cols-1 sm:grid-cols-2 gap-3">
<div class="order-2 sm:order-1 flex flex-col items-center justify-center sm:items-start">
<div class="legal">
<a href="/legal/terms" class="text-spaghetti-red hover:text-spaghetti-brown dark:hover:text-spaghetti-brown transition-colors duration-300 ease-in-out">
<a href="/legal/terms-of-service" class="text-link hover:text-link-hover transition-colors duration-300 ease-in-out">
Terms
</a> |
<a href="/legal/privacy" class="text-spaghetti-red hover:text-spaghetti-brown dark:hover:text-spaghetti-brown transition-colors duration-300 ease-in-out">
<a href="/legal/privacy-policy" class="text-link hover:text-link-hover transition-colors duration-300 ease-in-out">
Privacy
</a>
</div>
<div class="text-sm mt-2 text-spaghetti-brown">
<div class="text-sm mt-2 text-ink-muted">
&copy; {new Date().getFullYear()} | All rights reserved
</div>
</div>
@@ -66,9 +66,9 @@ import Container from "@components/Container.astro"
href={SOCIAL.HREF}
target="_blank"
aria-label={`${SITE.TITLE} on ${SOCIAL.NAME}`}
class="group size-10 rounded-full p-2 items-center justify-center hover:bg-black/5 dark:hover:bg-white/20 blend"
class="group size-10 rounded-full p-2 items-center justify-center hover:bg-chip blend"
>
<svg class="size-full fill-current group-hover:fill-black group-hover:dark:fill-white blend">
<svg class="size-full fill-current group-hover:fill-chip-ink blend">
<use href={`/social.svg#${SOCIAL.ICON}`} />
</svg>
</a>
+26 -12
View File
@@ -1,17 +1,20 @@
---
import { SITE, LINKS } from "@consts"
import { cn } from "@lib/utils"
const { pathname } = Astro.url
const subpath = pathname.match(/[^/]+/g)
import { SITE, LINKS, RESUME } from "@consts"
import { cn, ACTIVE_NAV_COLORS, isNavActive } from "@lib/utils"
import Container from "@components/Container.astro"
const { pathname } = Astro.url
---
<header id="header" class="fixed top-0 w-full h-16 z-50 ">
<Container size="md">
<!-- `lg`, not `md`: the header row has to fit the brand, five nav pills and the icon cluster
on one line. In a 768px container the Résumé pill pushed the cluster onto the nav's last
item (measured 1px of clearance at every width >= 800). The content column below stays
`md`; only the header bar is wider. -->
<Container size="lg">
<div class="relative h-full w-full">
<div class="absolute left-0 top-1/2 -translate-y-1/2 flex gap-1 font-semibold">
<a href="/" class="flex gap-1 text-current hover:text-spaghetti-brown dark:hover:text-spaghetti-brown transition-colors duration-300 ease-in-out">
<img src="/images/logo.png" alt="Logo" class="size-6" />
<a href="/" class="flex gap-1 text-ink transition-colors duration-300 ease-in-out hover:text-link">
<img src='/images/logo.png' alt="Logo" class="size-6" />
<div>
{SITE.TITLE}
</div>
@@ -22,7 +25,7 @@ import Container from "@components/Container.astro"
<nav class="hidden md:flex items-center justify-center text-sm gap-1">
{
LINKS.map((LINK) => (
<a href={LINK.HREF} class={cn("h-8 rounded-full px-3 text-current", "flex items-center justify-center", "transition-colors duration-300 ease-in-out", pathname === LINK.HREF || "/" + subpath?.[0] === LINK.HREF ? "bg-spaghetti-red dark:bg-spaghetti-red text-spaghetti-brown dark:text-spaghetti-brown" : "hover:bg-black/5 dark:hover:bg-white/20 hover:text-black dark:hover:text-white")}>
<a href={LINK.HREF} class={cn("h-8 rounded-full px-3 text-ink", "flex items-center justify-center", "transition-colors duration-300 ease-in-out", isNavActive(pathname, LINK.HREF) ? ACTIVE_NAV_COLORS : "hover:bg-wash hover:text-link")}>
{LINK.TEXT}
</a>
))
@@ -31,19 +34,19 @@ import Container from "@components/Container.astro"
</div>
<div class="buttons absolute right-0 top-1/2 -translate-y-1/2 flex gap-1">
<a href="/search" aria-label={`Search blog posts and projects on ${SITE.TITLE}`} class={cn("hidden md:flex", "size-9 rounded-full p-2 items-center justify-center", "bg-transparent hover:bg-spaghetti-yellow dark:hover:bg-spaghetti-yellow", "stroke-current hover:stroke-black hover:dark:stroke-white", "border border-black/10 dark:border-white/25", "transition-colors duration-300 ease-in-out", pathname === "/search" || "/" + subpath?.[0] === "/search" ? "pointer-events-none bg-spaghetti-red dark:bg-spaghetti-red text-spaghetti-brown dark:text-spaghetti-brown" : "")}>
<a href="/search" aria-label={`Search blog posts and projects on ${SITE.TITLE}`} class={cn("hidden md:flex", "size-9 rounded-full p-2 items-center justify-center", "bg-transparent stroke-current", "border border-edge", "hover:bg-chip hover:text-chip-ink", "transition-colors duration-300 ease-in-out", isNavActive(pathname, "/search") && "pointer-events-none", isNavActive(pathname, "/search") && ACTIVE_NAV_COLORS)}>
<svg class="size-full">
<use href="/ui.svg#search"></use>
</svg>
</a>
<a href="/rss.xml" target="_blank" aria-label={`Rss feed for ${SITE.TITLE}`} class={cn("hidden md:flex", "size-9 rounded-full p-2 items-center justify-center", "bg-transparent hover:bg-spaghetti-yellow dark:hover:bg-spaghetti-yellow", "stroke-current hover:stroke-black hover:dark:stroke-white", "border border-black/10 dark:border-white/25", "transition-colors duration-300 ease-in-out")}>
<a href="/rss.xml" target="_blank" aria-label={`Rss feed for ${SITE.TITLE}`} class={cn("hidden md:flex", "size-9 rounded-full p-2 items-center justify-center", "bg-transparent stroke-current", "border border-edge", "hover:bg-chip hover:text-chip-ink", "transition-colors duration-300 ease-in-out")}>
<svg class="size-full">
<use href="/ui.svg#rss"></use>
</svg>
</a>
<button id="header-theme-button" aria-label={`Toggle light and dark theme`} class={cn("hidden md:flex", "size-9 rounded-full p-2 items-center justify-center", "bg-transparent hover:bg-spaghetti-yellow dark:hover:bg-spaghetti-yellow", "stroke-current hover:stroke-black hover:dark:stroke-white", "border border-black/10 dark:border-white/25", "transition-colors duration-300 ease-in-out")}>
<button id="header-theme-button" aria-label={`Toggle light and dark theme`} class={cn("hidden md:flex", "size-9 rounded-full p-2 items-center justify-center", "bg-transparent stroke-current", "border border-edge", "hover:bg-chip hover:text-chip-ink", "transition-colors duration-300 ease-in-out")}>
<svg class="size-full block dark:hidden">
<use href="/ui.svg#sun"></use>
</svg>
@@ -52,7 +55,18 @@ import Container from "@components/Container.astro"
</svg>
</button>
<button id="header-drawer-button" aria-label={`Toggle drawer open and closed`} class={cn("flex md:hidden", "size-9 rounded-full p-2 items-center justify-center", "bg-spaghetti-red dark:bg-spaghetti-red", "stroke-current hover:stroke-black hover:dark:stroke-white text-spaghetti-brown dark:text-spaghetti-brown", "border border-black/10 dark:border-white/25", "transition-colors duration-300 ease-in-out")}>
<!-- Résumé sits right of the theme toggle: the pill is the widest item in the
cluster, so leading with it pushed the nav pills together. Below `lg` it
collapses to a 36px icon-only circle to leave the nav room; the drawer
carries the labelled link. -->
<a href={RESUME.HREF} target="_blank" rel="noopener noreferrer" aria-label={`${RESUME.TEXT} for ${SITE.AUTHOR}, opens in a new tab`} class={cn("flex shrink-0 items-center justify-center gap-1.5 h-9 w-9 rounded-full lg:w-auto lg:pl-2.5 lg:pr-3 text-sm font-semibold", "bg-chip text-chip-ink stroke-current", "border border-edge", "hover:bg-link hover:text-page hover:border-link", "transition-colors duration-300 ease-in-out")}>
<svg class="size-5 shrink-0 lg:size-4" fill="none">
<use href={`/ui.svg#${RESUME.ICON}`}></use>
</svg>
<span class="hidden lg:inline">{RESUME.TEXT}</span>
</a>
<button id="header-drawer-button" aria-label={`Toggle drawer open and closed`} class={cn("flex md:hidden", "size-9 rounded-full p-2 items-center justify-center", ACTIVE_NAV_COLORS, "stroke-current", "border border-edge", "transition-colors duration-300 ease-in-out")}>
<svg id="drawer-open" class="size-full">
<use href="/ui.svg#menu"></use>
</svg>
+63
View File
@@ -0,0 +1,63 @@
---
/**
* MeatballShower.astro
* This component creates shooting meatballs that are appended to the galaxy on interval.
* Each streak is a trail of marinara with a meatball at the head. Meatballs are removed from
* the document after the animation is completed.
* There are four (4) shower containers, one for each diagonal direction.
*/
---
<div id="meatballs">
<!-- rotations defined in global.css -->
<div class="shower ur" />
<div class="shower dr" />
<div class="shower dl" />
<div class="shower ul" />
</div>
<script>
const sauceVariants = ["v1", "v2", "v3"];
function randomInt(min: number, max: number) {
return Math.round(Math.random() * (max - min) + min);
}
function createMeatball () {
// create a meatball with a randomized size and sauce pattern
let meatball = document.createElement("div");
const sauceVariant = sauceVariants[Math.floor(Math.random() * sauceVariants.length)];
meatball.setAttribute("class", `meatball ${sauceVariant}`);
meatball.style.left = Math.round(Math.random() * window.innerWidth) + "px";
meatball.style.top = Math.round(Math.random() * window.innerHeight) + "px";
// the ball and its marinara trail are smaller on phones
const isSmall = window.innerWidth < 768;
meatball.style.setProperty("--ball-size", `${randomInt(isSmall ? 7 : 9, isSmall ? 10 : 14)}px`);
meatball.style.setProperty("--trail-length", `${randomInt(isSmall ? 22 : 30, isSmall ? 34 : 45)}vh`);
meatball.style.setProperty("--trail-width", `${randomInt(isSmall ? 9 : 12, isSmall ? 14 : 18)}px`);
// the marinara trail, the meatball at its head, and the droplets flung behind it
for (const layer of ["trail", "ball", "splatter"]) {
const el = document.createElement("span");
el.setAttribute("class", layer);
meatball.append(el);
}
// append the meatball to a random shower (direction)
const showers = document.querySelectorAll("#meatballs .shower");
if (showers.length > 0) {
const random = Math.floor(Math.random() * showers.length);
const shower = showers[random];
shower.append(meatball);
}
// remove the meatball after the animation duration
setTimeout(() => {
meatball.remove();
}, 3500);
}
// Create meatballs on interval on 1.5 seconds
setInterval(createMeatball, 1500);
</script>
-42
View File
@@ -1,42 +0,0 @@
---
/**
* Meteors.astro
* This component creates meteors that are appended to the galaxy on interval.
* Meteors are removed from the document after the animation is completed.
* There are four (4) meteor shower containers, one for each diagonal direction.
*/
---
<div id="meteors">
<!-- rotations defined in base.css & tailwind.config.mjs -->
<div class="shower ur" />
<div class="shower dr" />
<div class="shower dl" />
<div class="shower ul" />
</div>
<script>
function createMeteor () {
// create a meteor
let meteor = document.createElement("div");
meteor.setAttribute("class", "meteor");
meteor.style.left = Math.round(Math.random() * window.innerWidth) + "px";
meteor.style.top = Math.round(Math.random() * window.innerHeight) + "px";
// append the meteor to a random meteor shower (direction)
const showers = document.querySelectorAll(".shower");
if (showers.length > 0) {
const random = Math.floor(Math.random() * showers.length);
const shower = showers[random];
shower.append(meteor);
}
// remove the meteor after the animation duration
setTimeout(() => {
meteor.remove();
}, 3500);
}
// Create meteors on interval on two (2) seconds
setInterval(createMeteor, 1500);
</script>
+58
View File
@@ -0,0 +1,58 @@
---
/**
* ParmesanFlecks.astro
* This component creates flecks of parmesan that twinkle in the night sky and are appended to
* the galaxy on interval. Flecks are removed from the document after the animation is completed.
* The svg below is just a template for the script to clone and append to the galaxy.
*/
---
<svg
id="parmesan-fleck"
class="template"
width="149"
height="149"
viewBox="0 0 149 149"
fill="none"
xmlns="http://www.w3.org/2000/svg"
class="absolute left-full animate-twinkle"
>
<defs>
<radialGradient id="fleck_glow_4_2" cx="74" cy="74" r="70" gradientUnits="userSpaceOnUse">
<stop stop-color="#FFF6E5"/>
<stop offset="0.45" stop-color="#F5E6D3"/>
<stop offset="1" stop-color="#F5E6D3" stop-opacity="0"/>
</radialGradient>
</defs>
<!-- the soft glow of the fleck catching the light -->
<circle cx="74" cy="74" r="66" fill="url(#fleck_glow_4_2)" opacity="0.22"/>
<!-- the grate's offcuts: one pale irregular shard, two smaller chips -->
<path d="M48 40 L96 42 L108 76 L74 102 L44 84 L36 56 Z" fill="#FFF6E5"/>
<path d="M110 28 L130 34 L124 54 L104 46 Z" fill="#F5E6D3" opacity="0.8"/>
<path d="M28 96 L50 104 L42 124 L24 112 Z" fill="#F5E6D3" opacity="0.6"/>
</svg>
<script is:inline>
// Generate a parmesan fleck and append it to the galaxy, remove it after animation.
function generateParmesanFleck() {
const fleckTemplate = document.getElementById("parmesan-fleck")
if (!fleckTemplate) { return; }
// Clone the parmesan fleck template and set its attributes.
const fleck = fleckTemplate.cloneNode(true);
fleck.style.position = "absolute";
fleck.style.left = Math.floor(Math.random() * window.innerWidth) + "px";
fleck.style.top = Math.floor(Math.random() * (window.innerHeight/3)) + "px";
fleck.style.width = (window.innerWidth < 768 ? Math.floor(Math.random() * (15 - 7.5 + 1) + 7.5) : Math.floor(Math.random() * (30 - 15 + 1) + 15)) + "px";
fleck.style.height = fleck.style.width;
fleck.classList.add("fleck");
document.getElementById("galaxy").appendChild(fleck);
// Remove the fleck after the animation is completed.
setTimeout(() => {
fleck.remove();
}, 2500);
}
setInterval(generateParmesanFleck, 5000);
</script>
-72
View File
@@ -1,72 +0,0 @@
import type { CollectionEntry } from "astro:content"
import { createEffect, createSignal, For } from "solid-js"
import ArrowCard from "@components/ArrowCard"
import { cn } from "@lib/utils"
type Props = {
tags: string[]
data: CollectionEntry<"projects">[]
}
export default function Projects({ data, tags }: Props) {
const [filter, setFilter] = createSignal(new Set<string>())
const [projects, setProjects] = createSignal<CollectionEntry<"projects">[]>([])
createEffect(() => {
setProjects(data.filter((entry) =>
Array.from(filter()).every((value) =>
entry.data.tags.some((tag:string) =>
tag.toLowerCase() === String(value).toLowerCase()
)
)
))
})
function toggleTag(tag: string) {
setFilter((prev) =>
new Set(prev.has(tag)
? [...prev].filter((t) => t !== tag)
: [...prev, tag]
)
)
}
return (
<div class="grid grid-cols-1 sm:grid-cols-3 gap-6">
<div class="col-span-3 sm:col-span-1">
<div class="sticky top-24">
<div class="text-sm font-semibold uppercase mb-2 text-spaghetti-brown">Filter</div>
<ul class="flex flex-wrap sm:flex-col gap-1.5">
<For each={tags}>
{(tag) => (
<li>
<button onClick={() => toggleTag(tag)} class={cn("w-full px-2 py-1 rounded", "whitespace-nowrap overflow-hidden overflow-ellipsis", "flex gap-2 items-center", "bg-spaghetti-yellow/20 dark:bg-spaghetti-yellow/20", "hover:bg-spaghetti-yellow/30 hover:dark:bg-spaghetti-yellow/30", "transition-colors duration-300 ease-in-out", filter().has(tag) && "text-spaghetti-brown dark:text-spaghetti-brown")}>
<svg class={cn("size-5 fill-spaghetti-brown/50 dark:fill-spaghetti-brown/50", "transition-colors duration-300 ease-in-out", filter().has(tag) && "fill-spaghetti-brown dark:fill-spaghetti-brown")}>
<use href={`/ui.svg#square`} class={cn(!filter().has(tag) ? "block" : "hidden")} />
<use href={`/ui.svg#square-check`} class={cn(filter().has(tag) ? "block" : "hidden")} />
</svg>
{tag}
</button>
</li>
)}
</For>
</ul>
</div>
</div>
<div class="col-span-3 sm:col-span-2">
<div class="flex flex-col">
<div class="text-sm uppercase mb-2">
SHOWING {projects().length} OF {data.length} PROJECTS
</div>
<ul class="flex flex-col gap-3">
{projects().map((project) => (
<li>
<ArrowCard entry={project} />
</li>
))}
</ul>
</div>
</div>
</div>
)
}
+166 -29
View File
@@ -1,29 +1,105 @@
import type { CollectionEntry } from "astro:content"
import { createEffect, createSignal } from "solid-js"
import Fuse from "fuse.js"
import { createEffect, createSignal, onCleanup, onMount } from "solid-js"
import ArrowCard from "@components/ArrowCard"
import {
createSearcher,
partitionByCollection,
runSearch,
MIN_QUERY_LENGTH,
type SearchEntry,
} from "@lib/search"
type Props = {
data: CollectionEntry<"blog">[]
query?: string
/** Slim searchable entries serialized by src/pages/search/index.astro */
entries?: SearchEntry[]
}
export default function Search({data}: Props) {
const [query, setQuery] = createSignal("")
const [results, setResults] = createSignal<CollectionEntry<"blog">[]>([])
const QUERY_PARAM = "search"
const DEBOUNCE_MS = 300
const fuse = new Fuse(data, {
keys: ["slug", "data.title", "data.summary", "data.tags"],
includeMatches: true,
minMatchCharLength: 2,
threshold: 0.4,
})
export default function Search(props: Props) {
const [query, setQuery] = createSignal(props.query || "")
const [results, setResults] = createSignal<{ posts: SearchEntry[]; projects: SearchEntry[] }>({ posts: [], projects: [] })
const [searched, setSearched] = createSignal(false)
const [loading, setLoading] = createSignal(false)
const [error, setError] = createSignal<string | null>(null)
// Build the fuzzy index once per hydration; keystrokes reuse it.
const searcher = createSearcher(props.entries || [])
// Debounce timer reference (browser-safe type; `NodeJS.Timeout` leaks
// Node types into a client component).
let debounceTimer: ReturnType<typeof setTimeout> | null = null
/**
* Mirror the active query into the URL so refresh, back/forward and sharing
* all restore the same result set. `replaceState` keeps history tidy while
* typing; explicit submits push a real entry.
*/
const syncUrl = (q: string, push = false) => {
// Guard: this component is SSR'd, and history APIs are unavailable there.
if (typeof window === "undefined") return
const url = new URL(window.location.href)
if (q.trim().length >= MIN_QUERY_LENGTH) {
url.searchParams.set(QUERY_PARAM, q)
} else {
url.searchParams.delete(QUERY_PARAM)
}
if (push) {
window.history.pushState({}, "", url.toString())
} else {
window.history.replaceState({}, "", url.toString())
}
}
createEffect(() => {
if (query().length < 2) {
setResults([])
} else {
setResults(fuse.search(query()).map((result) => result.item))
const q = query()
if (q.trim().length < MIN_QUERY_LENGTH) {
if (debounceTimer) clearTimeout(debounceTimer)
setResults({ posts: [], projects: [] })
setSearched(false)
setLoading(false)
setError(null)
return
}
if (debounceTimer) clearTimeout(debounceTimer)
setLoading(true)
debounceTimer = setTimeout(() => {
try {
const matched = runSearch(searcher, q)
setResults(partitionByCollection(matched))
setSearched(true)
setError(null)
// Keep the address bar in sync so the current results are shareable
// and survive a refresh.
syncUrl(q)
} catch (err) {
console.error("Search error:", err)
setResults({ posts: [], projects: [] })
setSearched(true)
setError("Search failed. Please try again.")
} finally {
setLoading(false)
}
}, DEBOUNCE_MS)
})
// Restore the query when the user navigates with browser back/forward.
const onPopState = () => {
setQuery(new URL(window.location.href).searchParams.get(QUERY_PARAM) || "")
}
// IMPORTANT: this component is SSR'd (output: "server" + client:load). The
// component body runs on the server AND Solid runs onCleanup during server
// teardown, while onMount never runs on the server. So every browser-API
// touchpoint must either live in onMount or be gated by `popStateBound`.
let popStateBound = false
onMount(() => {
window.addEventListener("popstate", onPopState)
popStateBound = true
})
const onInput = (e: Event) => {
@@ -31,26 +107,87 @@ export default function Search({data}: Props) {
setQuery(target.value)
}
const handleSubmit = (e: Event) => {
e.preventDefault()
// Never let the browser do a full page reload; the createEffect re-runs
// the search and syncUrl keeps the address bar shareable.
if (query().trim().length >= MIN_QUERY_LENGTH) {
syncUrl(query(), true)
}
}
// Cleanup the debounce timer (safe on server) and the history listener,
// which is only ever bound in the browser.
onCleanup(() => {
if (debounceTimer) clearTimeout(debounceTimer)
if (popStateBound) window.removeEventListener("popstate", onPopState)
})
return (
<div class="flex flex-col">
<div class="relative">
<input name="search" type="text" value={query()} onInput={onInput} autocomplete="off" spellcheck={false} placeholder="What are you looking for?" class="w-full px-2.5 py-1.5 pl-10 rounded outline-none text-spaghetti-brown bg-spaghetti-yellow/20 dark:bg-spaghetti-yellow/20 border border-spaghetti-yellow/50 dark:border-spaghetti-yellow/50 focus:border-spaghetti-red focus:dark:border-spaghetti-red"/>
<form onSubmit={handleSubmit} class="relative" classList={{ "animate-pulse": loading() }}>
<input
name="search"
type="text"
value={query()}
onInput={onInput}
autocomplete="off"
spellcheck={false}
placeholder="What are you looking for?"
class="w-full px-2.5 py-1.5 pl-10 rounded outline-none text-ink bg-chip border border-edge focus:border-link"
/>
<svg class="absolute size-6 left-1.5 top-1/2 -translate-y-1/2 stroke-current">
<use href={`/ui.svg#search`}/>
</svg>
</div>
{(query().length >= 2 && results().length >= 1) && (
</form>
{error() && <div class="mt-4 text-status-down">{error()}</div>}
{loading() && <div class="mt-4">Searching...<span class="ml-2 animate-spin">⏳</span></div>}
{!loading() && !error() && !searched() && query().trim().length > 0 && query().trim().length < MIN_QUERY_LENGTH && (
<div class="mt-4 text-sm uppercase text-ink-muted">
Keep typing — search needs at least {MIN_QUERY_LENGTH} characters
</div>
)}
{!loading() && !error() && searched() && results().posts.length + results().projects.length === 0 && (
<div class="mt-12">
<div class="text-sm uppercase mb-2">
Found {results().length} results for {`'${query()}'`}
No results for {`'${query()}'`}
</div>
<div class="text-sm text-ink-muted">
Try a shorter or more general keyword — titles, tags and summaries are all searchable.
</div>
</div>
)}
{(searched() && (results().posts.length > 0 || results().projects.length > 0)) && (
<div class="mt-12">
<div class="text-sm uppercase mb-2">
Found {results().posts.length + results().projects.length} results for {`'${query()}'`}
</div>
<div class="flex flex-col gap-6 mt-4">
{results().posts.length > 0 && (
<div class="border-t border-line pt-4">
<div class="text-sm font-bold mb-2">Blog Posts</div>
<ul class="flex flex-col gap-3">
{results().posts.map(result => (
<li>
<ArrowCard entry={result} pill={true} collection={'blog'} />
</li>
))}
</ul>
</div>
)}
{results().projects.length > 0 && (
<div class="border-t border-line pt-4">
<div class="text-sm font-bold mb-2">Projects</div>
<ul class="flex flex-col gap-3">
{results().projects.map(result => (
<li>
<ArrowCard entry={result} pill={true} collection={'projects'} />
</li>
))}
</ul>
</div>
)}
</div>
<ul class="flex flex-col gap-3">
{results().map(result => (
<li>
<ArrowCard entry={result} pill={true} />
</li>
))}
</ul>
</div>
)}
</div>
+2 -2
View File
@@ -8,11 +8,11 @@ type Props = {
const { text, icon, href } = Astro.props
---
<a href={href} target="_blank" class="w-fit px-3 py-2 group rounded border flex gap-2 items-center border-spaghetti-yellow/50 dark:border-spaghetti-yellow/50 hover:bg-spaghetti-yellow/20 hover:dark:bg-spaghetti-yellow/20 blend">
<a href={href} target="_blank" class="w-fit px-3 py-2 group rounded border flex gap-2 items-center border-edge hover:bg-chip blend">
<svg height={20} width={20}>
<use href={`/stack.svg#${icon}`}></use>
</svg>
<span class="text-sm capitalize text-spaghetti-brown group-hover:text-spaghetti-brown blend">
<span class="text-sm capitalize text-ink group-hover:text-chip-ink blend">
{text}
</span>
</a>
+172
View File
@@ -0,0 +1,172 @@
---
import type { StatusSnapshot } from "@lib/status"
interface Props {
snapshot: StatusSnapshot
}
const { snapshot } = Astro.props
// Refresh cadence for the browser. The server already caches Uptime Kuma for a
// minute, so polling faster than that only adds requests without new signal.
const REFRESH_MS = 60_000
function details(s: StatusSnapshot): string {
const { total, up, down, pending, maintenance } = s.summary
if (s.state === "unknown") {
return s.reason === "stale"
? "Uptime Kuma has not reported recently"
: "Status could not be read"
}
const parts = [`${up}/${total} monitors up`]
if (down > 0) parts.push(`${down} down`)
if (pending > 0) parts.push(`${pending} pending`)
if (maintenance > 0) parts.push(`${maintenance} in maintenance`)
if (s.incidents > 0) parts.push(`${s.incidents} incident${s.incidents === 1 ? "" : "s"}`)
return parts.join(", ")
}
const state = snapshot.state
const label = snapshot.label
const detailsText = details(snapshot)
---
<a
href={snapshot.statusPageUrl}
target="_blank"
rel="noopener noreferrer"
class="status group flex gap-2 justify-center sm:justify-end items-center text-ink-muted hover:text-ink"
data-status-root
data-status={state}
data-refresh-ms={REFRESH_MS}
data-checked-at={snapshot.checkedAt}
aria-label={`System status: ${label}. ${detailsText}. Open status page`}
title={detailsText}
>
<span class="relative flex h-3 w-3" aria-hidden="true">
<span class="ping animate-ping absolute inline-flex h-full w-full rounded-full"></span>
<span class="core relative inline-flex rounded-full h-3 w-3"></span>
</span>
<span data-status-label>{label}</span>
</a>
<style>
/* Colours hang off data-status so the client script only has to flip one
attribute; Tailwind cannot generate classes built at runtime anyway. */
.status {
transition: color 300ms ease-in-out;
}
.core {
background-color: var(--color-status-ok);
transition: background-color 300ms ease-in-out;
}
.ping {
background-color: var(--color-status-ok-ping);
}
[data-status="degraded"] .core {
background-color: var(--color-status-warn);
}
[data-status="degraded"] .ping {
background-color: var(--color-status-warn-ping);
}
[data-status="down"] .core {
background-color: var(--color-status-down);
}
[data-status="down"] .ping {
background-color: var(--color-status-down-ping);
}
[data-status="maintenance"] .core {
background-color: var(--color-status-maint);
}
[data-status="maintenance"] .ping {
background-color: var(--color-status-maint-ping);
}
[data-status="unknown"] .core {
background-color: var(--color-status-unknown);
}
[data-status="unknown"] .ping {
display: none;
}
@media (prefers-reduced-motion: reduce) {
.ping {
display: none;
}
}
</style>
<script>
const root = document.querySelector<HTMLElement>("[data-status-root]")
const labelNode = root?.querySelector<HTMLElement>("[data-status-label]")
if (root && labelNode) {
const refreshMs = Number(root.dataset.refreshMs) || 60_000
let timer: ReturnType<typeof setInterval> | null = null
const render = (snapshot: {
state: string
label: string
summary?: { up: number; total: number }
}) => {
root.dataset.status = snapshot.state
labelNode.textContent = snapshot.label
const details = snapshot.summary
? `${snapshot.summary.up}/${snapshot.summary.total} monitors up`
: ""
root.title = details || snapshot.label
root.setAttribute(
"aria-label",
`System status: ${snapshot.label}. ${details}. Open status page`
)
}
const refresh = async () => {
try {
const response = await fetch("/api/status", {
headers: { accept: "application/json" },
cache: "default",
})
if (!response.ok) throw new Error(`status endpoint returned ${response.status}`)
render(await response.json())
} catch {
// The site's own route failed (or Uptime Kuma is unreachable). Say so
// rather than leaving a confident green light on a dead stack.
root.dataset.status = "unknown"
labelNode.textContent = "Status unavailable"
}
}
const start = () => {
if (timer !== null) return
timer = setInterval(refresh, refreshMs)
}
const stop = () => {
if (timer === null) return
clearInterval(timer)
timer = null
}
// A background tab should not burn requests; refresh the moment it is seen.
document.addEventListener("visibilitychange", () => {
if (document.hidden) stop()
else {
void refresh()
start()
}
})
// No immediate fetch when the server just rendered the state. Prerendered
// routes (blog posts, legal pages) bake the build-time snapshot, so compare
// timestamps and refresh straight away if what we were handed is old.
const checkedAt = Date.parse(root.dataset.checkedAt ?? "")
if (Number.isNaN(checkedAt) || Date.now() - checkedAt > refreshMs) void refresh()
start()
}
</script>
-62
View File
@@ -1,62 +0,0 @@
---
/**
* TwinkleStars.astro
* This component creates twinkling stars that are appended to the galaxy on interval.
* Twinkle stars are removed from the document after the animation is completed.
* The svg below is just a template for the script to clone and append to the galaxy.
*/
---
<svg
id="twinkle-star"
class="template"
width="149"
height="149"
viewBox="0 0 149 149"
fill="none"
xmlns="http://www.w3.org/2000/svg"
class="absolute left-full animate-twinkle"
>
<circle cx="74" cy="74" r="11" fill="white"/>
<rect y="141.421" width="200" height="10" transform="rotate(-45 0 141.421)" fill="url(#paint0_linear_4_2)"/>
<rect x="7.07107" width="200" height="10" transform="rotate(45 7.07107 0)" fill="url(#paint1_linear_4_2)"/>
<defs>
<linearGradient id="paint0_linear_4_2" x1="0" y1="146.421" x2="200" y2="146.421" gradientUnits="userSpaceOnUse">
<stop stop-color="#1E1E1E"/>
<stop offset="0.445" stop-color="white"/>
<stop offset="0.58721" stop-color="white"/>
<stop offset="1" stop-color="#1E1E1E"/>
</linearGradient>
<linearGradient id="paint1_linear_4_2" x1="7.07107" y1="5" x2="207.071" y2="5" gradientUnits="userSpaceOnUse">
<stop stop-color="#1E1E1E"/>
<stop offset="0.42" stop-color="white"/>
<stop offset="0.555" stop-color="white"/>
<stop offset="1" stop-color="#1E1E1E"/>
</linearGradient>
</defs>
</svg>
<script is:inline>
// Generate a twinkle star and append it to the galaxy, remove it after animation.
function generateTwinkleStar() {
const twinkleStarTemplate = document.getElementById("twinkle-star")
if (!twinkleStarTemplate) { return; }
// Clone the twinkle star template and set its attributes.
const twinkleStar = twinkleStarTemplate.cloneNode(true);
twinkleStar.style.position = "absolute";
twinkleStar.style.left = Math.floor(Math.random() * window.innerWidth) + "px";
twinkleStar.style.top = Math.floor(Math.random() * (window.innerHeight/3)) + "px";
twinkleStar.style.width = window.innerWidth < 768 ? Math.floor(Math.random() * (15 - 7.5 + 1) + 7.5) : Math.floor(Math.random() * (30 - 15 + 1) + 15) + "px";
twinkleStar.style.height = twinkleStar.style.width;
twinkleStar.classList.add("twinkle");
document.getElementById("galaxy").appendChild(twinkleStar);
// Remove the twinkle star after the animation is completed.
setTimeout(() => {
twinkleStar.remove();
}, 2500);
}
setInterval(generateTwinkleStar, 5000);
</script>
@@ -0,0 +1,153 @@
// src/components/__tests__/list-islands.test.ts
import { describe, it, expect } from "vitest"
import { renderToString } from "solid-js/web"
import FilteredList from "@components/FilteredList"
import type { FilterState, ListEntry } from "@lib/filters"
/**
* Renders the shared listing island through solid-js/web's server renderer,
* which is the same path Astro takes for `output: "server"` + `client:load`.
*
* The regression locked in here is that the list must exist in the SERVER HTML:
* the original `createEffect` + signal version rendered "SHOWING 0 OF 3" with an
* empty <ul>, so any hydration failure hid every entry. The second regression is
* the case-duplicated tag list, which made /blog and /projects render two
* checkboxes that did exactly the same thing.
*/
function entry(id: string, tags: string[], overrides: Partial<ListEntry> = {}): ListEntry {
return {
id,
title: `Entry ${id}`,
summary: `Summary ${id}`,
date: "2026-01-01T00:00:00.000Z",
tags,
...overrides,
}
}
const posts: ListEntry[] = [
entry("a", ["CSS", "Html"], { title: "Alpha", date: "2025-01-01T00:00:00.000Z" }),
entry("b", ["CSS", "css"], { title: "Bravo", date: "2026-01-01T00:00:00.000Z" }),
entry("c", ["html"], { title: "Charlie", date: "2025-06-01T00:00:00.000Z" }),
]
/**
* Solid's SSR output interleaves hydration markers around every dynamic value
* (`SHOWING <!--$-->3<!--/--> OF …`). Stripping comments keeps the assertions
* about real content instead of about marker placement.
*/
function render(props: {
entries?: ListEntry[]
collection?: "blog" | "projects"
initial?: FilterState
}): string {
const html = renderToString(() =>
FilteredList({
entries: props.entries ?? posts,
collection: props.collection ?? "blog",
initial: props.initial,
})
)
return html.replace(/<!--.*?-->/g, "")
}
describe("FilteredList island (SSR render)", () => {
it("should render every entry in the server HTML with no filter applied", () => {
const html = render({})
expect(html).toContain("SHOWING 3 OF 3 POSTS")
for (const item of posts) {
expect(html).toContain(`href="/blog/${item.id}"`)
}
})
it("should not regress to an empty list when no initial state is passed", () => {
// Guards the createEffect bug specifically: an untouched filter must show all.
expect(render({})).not.toContain("SHOWING 0")
})
it("should apply initial state server-side so a filtered deep link renders filtered", () => {
const html = render({ initial: { tags: ["css"], query: "", sort: "newest" } })
expect(html).toContain("SHOWING 2 OF 3 POSTS")
expect(html).toContain('href="/blog/a"')
expect(html).toContain('href="/blog/b"')
expect(html).not.toContain('href="/blog/c"')
})
it("should render one checkbox per tag, deduped across spellings", () => {
// `CSS`/`css` and `html`/`Html` collapse to two options, not four.
const html = render({})
expect(html).toContain(">CSS</span>")
expect(html).toContain(">Html</span>")
expect(html.match(/aria-pressed/g)).toHaveLength(2)
})
it("should show a per-tag count next to each option", () => {
// css -> a, b; html -> a, c. Assert on the rendered counts rather than on
// the exact class string so the test survives a restyle.
const html = render({})
const counts = [...html.matchAll(/<\/span><span[^>]*>(\d+)<\/span>/g)].map((m) => m[1])
expect(counts).toHaveLength(2)
expect(counts.every((count) => count === "2")).toBe(true)
})
it("should render the keyword input, sort select and live count region", () => {
const html = render({})
expect(html).toContain('id="filter-q"')
expect(html).toContain('id="filter-sort"')
expect(html).toContain('aria-live="polite"')
expect(html).toContain('role="group"')
expect(html).toContain("Newest first")
})
it("should sort by the requested key in the server HTML", () => {
const html = render({ initial: { tags: [], query: "", sort: "az" } })
expect(html.indexOf('href="/blog/a"')).toBeLessThan(html.indexOf('href="/blog/b"'))
})
it("should render an empty state instead of a blank list when nothing matches", () => {
const html = render({ initial: { tags: [], query: "zzzz", sort: "newest" } })
expect(html).toContain("SHOWING 0 OF 3 POSTS")
expect(html).toContain("No posts match these filters.")
expect(html).toContain("Clear filters")
})
it("should offer Clear all only once a filter is active", () => {
expect(render({})).not.toContain("Clear all")
expect(render({ initial: { tags: ["css"], query: "", sort: "newest" } })).toContain("Clear all")
})
it("should label the count PROJECTS for the projects collection", () => {
const html = render({
entries: [entry("x", ["react"]), entry("y", ["react", "rust"])],
collection: "projects",
})
expect(html).toContain("SHOWING 2 OF 2 PROJECTS")
expect(html).toContain('href="/projects/x"')
expect(html).toContain('href="/projects/y"')
})
it("should render an empty collection without throwing", () => {
// A collection where every entry is still a draft: no tags to list, nothing
// to show, and the empty state must carry the panel.
const html = render({ entries: [] })
expect(html).toContain("SHOWING 0 OF 0 POSTS")
expect(html).toContain("No posts match these filters.")
expect(html.match(/aria-pressed/g)).toBeNull()
})
it("should render entries that carry no tags at all", () => {
const html = render({ entries: [entry("solo", [])] })
expect(html).toContain("SHOWING 1 OF 1 POSTS")
expect(html).toContain('href="/blog/solo"')
})
})
+29 -1
View File
@@ -1,4 +1,4 @@
import type { Site, Page, Links, Socials } from "@types"
import type { Site, Page, Links, Socials, Cta } from "@types"
// Global
export const SITE: Site = {
@@ -31,7 +31,21 @@ export const SEARCH: Page = {
DESCRIPTION: "Search all posts and projects by keyword.",
}
// Docs (external, the Wiki.js instance hosted at docs.spaghet.io). Declared
// before LINKS because the Docs nav entry points at DOCS.HREF, and exported so
// both navs can label their links. It is a Cta (like RESUME) because it carries
// an icon; the nav entry itself is a plain Links row so it moves with the
// desktop nav / mobile drawer switch for free.
export const DOCS: Cta = {
TEXT: "Docs",
HREF: "https://docs.spaghet.io",
ICON: "book-open",
}
// Links
//
// Entries with EXTERNAL leave the site: they can never match Astro.url, so the
// renderers must skip the active-pill styling and add rel="noopener noreferrer".
export const LINKS: Links = [
{
TEXT: "Home",
@@ -49,8 +63,22 @@ export const LINKS: Links = [
TEXT: "Projects",
HREF: "/projects",
},
{
TEXT: DOCS.TEXT,
HREF: DOCS.HREF,
EXTERNAL: true,
},
]
// Résumé (external, hosted at resume.spaghet.io). Rendered as its own pill in
// the header rather than added to LINKS: LINKS drives the nav list and its
// active-page highlighting, and an off-site URL would never match a pathname.
export const RESUME: Cta = {
TEXT: "Résumé",
HREF: "https://resume.spaghet.io/quinn/default",
ICON: "resume",
}
// Socials
export const SOCIALS: Socials = [
{
+48
View File
@@ -0,0 +1,48 @@
import { defineCollection, z } from "astro:content"
import { glob } from "astro/loaders"
const blog = defineCollection({
loader: glob({ pattern: "**/*.md", base: "./src/content/blog" }),
schema: z.object({
title: z.string(),
summary: z.string(),
date: z.date(),
tags: z.array(z.string()),
draft: z.boolean().default(false),
template: z.string().default("default"),
featured: z.boolean().default(false),
}),
})
const projects = defineCollection({
loader: glob({ pattern: "**/*.md", base: "./src/content/projects" }),
schema: z.object({
title: z.string(),
summary: z.string(),
date: z.date(),
tags: z.array(z.string()),
draft: z.boolean().default(false),
demoUrl: z.string().optional(),
repoUrl: z.string().optional(),
}),
})
const work = defineCollection({
loader: glob({ pattern: "**/*.md", base: "./src/content/work" }),
schema: z.object({
company: z.string(),
role: z.string(),
dateStart: z.date(),
dateEnd: z.date(),
}),
})
const legal = defineCollection({
loader: glob({ pattern: "**/*.md", base: "./src/content/legal" }),
schema: z.object({
title: z.string(),
date: z.date(),
}),
})
export const collections = { blog, projects, work, legal }
@@ -1,15 +1,11 @@
---
title: "Building My Personal Website: From Idea to Deployment"
summary: "A journey through creating my personal portfolio site, from initial concept to hosting on Appwrite with NGINX Proxy Manager."
date: "Aug 12 2025"
summary: "A journey through creating my personal portfolio site, from initial concept to deployment."
date: 2025-08-12
tags: ["Tutorial", "Astro", "Portfolio", "Hosting", "Docker", "Website"]
draft: false
tags:
- Tutorial
- Astro
- Portfolio
- Hosting
- Appwrite
- Docker
template: "default"
featured: false
---
As someone who loves spaghetti and all things tech, I've always been fascinated by the perfect balance of structure and creativity. When it came time to create my personal website, I wanted to build something that reflected both my passion for technology and my love for well-organized systems.
@@ -27,6 +23,7 @@ The site needed to be:
## Development Process
I started by setting up the basic structure using Astro's capabilities. The site features:
- A clean, modern design with dark/light mode support
- Smooth animations and transitions for enhanced user experience
- Integrated blog section for technical articles
@@ -40,17 +37,16 @@ This is where things get interesting. As someone running 2 Unraid servers with p
### My Hosting Setup
I'm planning to host this site on my Appwrite instance, which is part of my comprehensive Docker container ecosystem. The setup includes:
- Appwrite for backend services and database management
- NGINX Proxy Manager (NPM) to expose the site via HTTPS at https://spaghet.io
I'm planning to host this site on my self-hosted infrastructure, which is part of my comprehensive Docker container ecosystem. The setup includes:
- A robust Docker infrastructure supporting PostgreSQL, MariaDB, MySQL, MongoDB, Redis, and Minio
### Challenges with Appwrite
## Deployment Challenges
While setting up the deployment, I've been working through some configuration challenges with Appwrite. Getting it to behave properly has been a learning experience, but also a great opportunity to dive deep into the platform's capabilities.
While setting up the deployment, I've been working through some configuration challenges. Getting the infrastructure to behave properly has been a learning experience, but also a great opportunity to dive deep into the platform's capabilities.
The process has involved:
- Understanding Appwrite's API structure
- Understanding the API structure
- Configuring proper database connections
- Setting up authentication and user management
- Ensuring proper security configurations
@@ -75,6 +71,6 @@ As I continue to develop this site, I plan to:
- Add more technical articles about my Docker setups and infrastructure
- Expand the blog section with detailed tutorials
- Continue refining the user experience based on feedback
- Document my journey of getting Appwrite to work properly
- Document my journey of getting the deployment infrastructure to work properly
This project represents not just a portfolio, but also a demonstration of my approach to technology - structured yet creative, efficient yet elegant.
This project represents not just a portfolio, but also a demonstration of my approach to technology - structured yet creative, efficient yet elegant.
@@ -1,66 +0,0 @@
---
title: "Fixing Appwrite Issues: Correcting NGINX Forwarding and Reverse Proxy Configuration"
summary: "A detailed walkthrough of how I resolved nginx forwarding issues to properly configure reverse proxy redirection for my Appwrite deployments."
date: "Aug 13 2025"
draft: false
tags:
- Tutorial
- Appwrite
- NGINX
- Reverse Proxy
- Docker
- Troubleshooting
---
As someone who loves to dive deep into technical challenges, I recently encountered a frustrating issue with my Appwrite setup that required some serious troubleshooting. The problem was related to nginx forwarding and reverse proxy configuration, which prevented my deployed websites from being properly accessible.
## The Problem
I was working on deploying multiple websites using Appwrite as part of my comprehensive Docker container ecosystem. My setup includes:
- Appwrite for backend services and database management
- NGINX Proxy Manager (NPM) to expose sites via HTTPS
- A robust Docker infrastructure supporting various services
The issue occurred when I tried to access my newly deployed websites through the reverse proxy. Instead of seeing my content, I was encountering errors or being redirected incorrectly.
## Root Cause Analysis
After extensive debugging, I discovered that the problem stemmed from improper nginx configuration for forwarding requests to Appwrite and the correct routing of those requests through my reverse proxy setup.
## The Solution
I had to make several key adjustments:
### 1. Ensuring Proper Reverse Proxy Configuration
Next, I made sure that the reverse proxy was correctly redirecting to my new websites:
```nginx
location / {
proxy_pass http://your-appwrite-container:80;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
```
## Key Takeaways
This experience taught me several important lessons about reverse proxy configuration in Docker environments:
1. **Network Configuration is Critical**: Make sure all containers are on the same network and can communicate properly.
2. **Header Settings Matter**: Properly setting `X-Forwarded-*` headers ensures that applications receive correct information about the original request.
3. **Testing Each Component**: When troubleshooting, test individual components (nginx, appwrite, docker networks) to isolate the root cause.
4. **Documentation**: Keep detailed notes of configuration changes for future reference and easier debugging.
## Final Result
After implementing these fixes, my Appwrite setup was working perfectly with proper nginx forwarding and reverse proxy redirection. I could now access all my deployed websites through the correct HTTPS endpoints managed by NGINX Proxy Manager.
This experience reinforced the importance of understanding how different components in a Docker ecosystem interact with each other, especially when it comes to networking and proxy configurations.
The solution not only fixed my immediate problem but also improved my overall understanding of how to properly configure reverse proxies for complex applications like Appwrite. This knowledge will be invaluable as I continue to expand my infrastructure and deploy more services.
@@ -0,0 +1,121 @@
---
title: "Spaghet.io Website Improvements: A Comprehensive UI/UX Overhaul"
summary: "Detailed summary of all the UI/UX improvements made to the Spaghet.io website, including dark mode fixes, theme enhancements, and component updates."
date: 2025-08-13
tags: ["website", "ui", "ux", "improvements", "spaghetti"]
draft: false
template: "default"
featured: false
---
## Introduction
This post documents a comprehensive UI/UX overhaul of my personal website, Spaghet.io. The changes were focused on improving visual consistency, fixing dark mode conflicts, and enhancing the overall user experience while maintaining our signature spaghetti-themed aesthetic.
## Goal of This Session
The primary objective was to enhance the website's visual design by:
- Resolving dark mode conflicts with prose elements
- Ensuring consistent theme application across all components
- Fixing text color issues in selected menu items and buttons
- Making sure the spaghetti theme is consistently applied throughout the site
## Key Improvements Made
### 1. Fixed Dark Mode Conflicts with tw-prose Classes
**Problem:** The website had conflicts where prose elements (blog content) were not respecting our custom theme colors in dark mode, resulting in poor readability.
**Solution:** Updated tailwind.config.mjs to properly customize typography styles. Added CSS overrides in global.css to ensure spaghetti-themed colors are applied consistently in prose elements.
### 2. Enhanced Theme Consistency Across Components
**Problem:** Various components had inconsistent color usage, particularly in text and hover states.
**Solution:** Updated Header component to use proper text-spaghetti-brown colors for hover states. Fixed Footer component with consistent text-spaghetti-brown colors for legal links. Applied consistent theme classes throughout ArrowCard, Blog, Projects, StackCard, Search, Counter, and Drawer components.
### 3. Implemented Spaghetti-Themed Color Palette
**Color Scheme:**
- Main color: #FDE68A (spaghetti-yellow)
- Accent color: #FECACA (spaghetti-red)
- Background: #FEF3C7 (spaghetti-cream)
- Text: #78350F (spaghetti-brown)
### 4. Fixed Selected Menu Items and Buttons
**Problem:** Selected menu items and buttons had light red backgrounds with white text, which was inconsistent with our theme.
**Solution:** Updated Header navigation items to use text-spaghetti-brown instead of text-white for selected states. Updated Drawer navigation items to use text-spaghetti-brown instead of text-white for selected states. Updated Search button in header to use text-spaghetti-brown instead of text-white for selected states. Updated mobile drawer button to use text-spaghetti-brown instead of text-white for selected states.
### 5. Enhanced Hero Section with Spaghetti Theme
**Improvements:** Applied consistent text-spaghetti-brown colors throughout the hero section. Styled call-to-action buttons with spaghetti-red background and spaghetti-yellow borders. Maintained consistent theme application throughout the entire hero section.
## Technical Implementation Details
### CSS Customizations
The following changes were made to src/styles/global.css:
```css
/* Override default prose styles to respect our theme */
.prose {
color: var(--spaghetti-brown);
}
.prose a {
color: var(--spaghetti-red);
}
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
color: var(--spaghetti-brown);
}
/* Ensure dark mode respects our theme */
.dark .prose {
color: var(--spaghetti-brown);
}
.dark .prose a {
color: var(--spaghetti-red);
}
```
### Component Updates
All affected components were updated to use:
- text-spaghetti-brown for text content
- bg-spaghetti-red for selected states
- border-spaghetti-yellow/50 for borders
- Consistent hover effects with appropriate color transitions
## Before and After Comparison
### Navigation Menu
- **Before:** Selected items had light red background (bg-spaghetti-red) with white text (text-white)
- **After:** Selected items have light red background (bg-spaghetti-red) with dark brown text (text-spaghetti-brown)
### Prose Elements
- **Before:** Default Tailwind prose styles were overriding our theme colors in dark mode
- **After:** Custom CSS ensures consistent spaghetti-themed colors across all content
### Hero Section
- **Before:** Inconsistent color usage throughout the hero section
- **After:** Cohesive spaghetti theme with consistent text-spaghetti-brown colors for all content
## Future Improvements
While these changes have significantly improved the website's UI/UX, there are always opportunities for further enhancement:
- Implement more sophisticated animations and transitions
- Add more interactive elements with our spaghetti theme
- Continue refining the dark mode experience
- Explore additional theme variations that maintain the spaghetti aesthetic
## Conclusion
These improvements represent a significant step forward in creating a consistent, visually appealing, and user-friendly website that truly embodies the spirit of spaghetti - structured, well-organized, and satisfying to use. The site now maintains a cohesive design language while providing an enhanced user experience across all device sizes and themes.
The changes ensure that our signature spaghetti theme is consistently applied throughout the entire website, from navigation elements to content presentation, creating a unified and memorable user experience.
@@ -1,134 +0,0 @@
---
title: "Spaghet.io Website Improvements: A Comprehensive UI/UX Overhaul"
date: 2025-08-13
summary: "Detailed summary of all the UI/UX improvements made to the Spaghet.io website, including dark mode fixes, theme enhancements, and component updates."
tags: [website, ui, ux, improvements, spaghetti]
draft: false
---
## Introduction
This post documents a comprehensive UI/UX overhaul of my personal website, Spaghet.io. The changes were focused on improving visual consistency, fixing dark mode conflicts, and enhancing the overall user experience while maintaining our signature spaghetti-themed aesthetic.
## Goal of This Session
The primary objective was to enhance the website's visual design by:
1. Resolving dark mode conflicts with prose elements
2. Ensuring consistent theme application across all components
3. Fixing text color issues in selected menu items and buttons
4. Making sure the spaghetti theme is consistently applied throughout the site
## Key Improvements Made
### 1. Fixed Dark Mode Conflicts with tw-prose Classes
**Problem**: The website had conflicts where prose elements (blog content) were not respecting our custom theme colors in dark mode, resulting in poor readability.
**Solution**:
- Updated `tailwind.config.mjs` to properly customize typography styles
- Added CSS overrides in `global.css` to ensure spaghetti-themed colors are applied consistently in prose elements
### 2. Enhanced Theme Consistency Across Components
**Problem**: Various components had inconsistent color usage, particularly in text and hover states.
**Solution**:
- Updated Header component to use proper text-spaghetti-brown colors for hover states
- Fixed Footer component with consistent text-spaghetti-brown colors for legal links
- Applied consistent theme classes throughout ArrowCard, Blog, Projects, StackCard, Search, Counter, and Drawer components
### 3. Implemented Spaghetti-Themed Color Palette
**Color Scheme**:
- Main color: `#FDE68A` (spaghetti-yellow)
- Accent color: `#FECACA` (spaghetti-red)
- Background: `#FEF3C7` (spaghetti-cream)
- Text: `#78350F` (spaghetti-brown)
### 4. Fixed Selected Menu Items and Buttons
**Problem**: Selected menu items and buttons had light red backgrounds with white text, which was inconsistent with our theme.
**Solution**:
- Updated Header navigation items to use `text-spaghetti-brown` instead of `text-white` for selected states
- Updated Drawer navigation items to use `text-spaghetti-brown` instead of `text-white` for selected states
- Updated Search button in header to use `text-spaghetti-brown` instead of `text-white` for selected states
- Updated mobile drawer button to use `text-spaghetti-brown` instead of `text-white` for selected states
### 5. Enhanced Hero Section with Spaghetti Theme
**Improvements**:
- Applied consistent text-spaghetti-brown colors throughout the hero section
- Styled call-to-action buttons with spaghetti-red background and spaghetti-yellow borders
- Maintained consistent theme application throughout the entire hero section
## Technical Implementation Details
### CSS Customizations
The following changes were made to `src/styles/global.css`:
```css
/* Override default prose styles to respect our theme */
.prose {
color: var(--spaghetti-brown);
}
.prose a {
color: var(--spaghetti-red);
}
.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
color: var(--spaghetti-brown);
}
/* Ensure dark mode respects our theme */
.dark .prose {
color: var(--spaghetti-brown);
}
.dark .prose a {
color: var(--spaghetti-red);
}
```
### Component Updates
All affected components were updated to use:
- `text-spaghetti-brown` for text content
- `bg-spaghetti-red` for selected states
- `border-spaghetti-yellow/50` for borders
- Consistent hover effects with appropriate color transitions
## Before and After Comparison
### Navigation Menu
**Before**: Selected items had light red background (`bg-spaghetti-red`) with white text (`text-white`)
**After**: Selected items have light red background (`bg-spaghetti-red`) with dark brown text (`text-spaghetti-brown`)
### Prose Elements
**Before**: Default Tailwind prose styles were overriding our theme colors in dark mode
**After**: Custom CSS ensures consistent spaghetti-themed colors across all content
### Hero Section
**Before**: Inconsistent color usage throughout the hero section
**After**: Cohesive spaghetti theme with consistent text-spaghetti-brown colors for all content
## Future Improvements
While these changes have significantly improved the website's UI/UX, there are always opportunities for further enhancement:
1. Implement more sophisticated animations and transitions
2. Add more interactive elements with our spaghetti theme
3. Continue refining the dark mode experience
4. Explore additional theme variations that maintain the spaghetti aesthetic
## Conclusion
These improvements represent a significant step forward in creating a consistent, visually appealing, and user-friendly website that truly embodies the spirit of spaghetti - structured, well-organized, and satisfying to use. The site now maintains a cohesive design language while providing an enhanced user experience across all device sizes and themes.
The changes ensure that our signature spaghetti theme is consistently applied throughout the entire website, from navigation elements to content presentation, creating a unified and memorable user experience.
@@ -0,0 +1,310 @@
---
title: "Running AI From My Own Computers: Two Servers, Two Very Different Jobs"
summary: "How I split my home servers into one that stores everything and one that thinks — in plain language, with the numbers, the mistakes I made, and how you could start the same thing much smaller."
date: 2026-11-03
tags: ["Homelab", "Unraid", "Storage", "Backup", "Docker", "Local AI", "NVIDIA"]
draft: false
template: "default"
featured: true
---
## The problem I wanted to solve
I want to run AI tools on my own computers. Not because it is cheaper — it usually
isn't, once you count the hardware and the electricity — but because half of what I want
to search through is my own paperwork: tax documents, contracts, notes, old projects, my
family's photo library. Uploading all of that to someone else's server just to ask one
question about it is not a trade I want to make by default.
The goal, in one sentence:
> Ask questions about my own files, and get an answer from a program running inside my
> own house.
## Why that turned out to be hard
This single sentence needs two opposite kinds of machine.
**Holding a lot of data safely** wants big, cheap, slow hard drives, and protection
against those drives dying.
**Thinking fast** wants enormous amounts of very expensive, very fast memory, plus a
graphics card.
A computer that is excellent at both does not exist at a sane price. It would either cost
a great deal or be bad at one of the two jobs. So I stopped trying to build one and split
the jobs across two machines:
- **MarvinBlade** — the machine that *remembers*. It holds the files and runs the
everyday services.
- **SpaghetAI** — the machine that *thinks*. It holds memory and graphics power for the
AI work, and almost no storage of its own.
Neither one does its job without the other, and the connection between them is where the
trouble lives. I'll get to that.
## A few words before the numbers
If you don't do this for a living, here is the vocabulary this post needs.
| Word | What it means here |
|---|---|
| **Storage** | Hard drives. Big, cheap, slow. Where files sit when nothing is using them. |
| **Memory (RAM)** | Fast working space. Expensive, and it forgets everything when the power goes out. Where data goes while it is actively in use. |
| **Graphics card (GPU)** | A video card, which turns out to be very good at the arithmetic AI needs. |
| **Card memory (VRAM)** | The fast space built into the graphics card. Faster again, and far more expensive. |
| **Container** | One program packaged together with everything it needs to run, so it can be started, stopped, or updated without disturbing the others. |
| **Protection drive (parity)** | An extra drive holding repair information, so that if a normal drive dies you can rebuild it from the rest. |
One analogy carries most of this post. Think of a kitchen:
- **Storage is the pantry.** Lots of room, and you have to get up and walk to it.
- **Memory is the counter.** Much smaller, and everything you are working on right now
has to be on it.
- **Card memory is the cutting board.** The smallest and dearest space, and the thing
you are actively working on has to be on it at the moment the knife comes down.
Anything you use often wants to be closer to the knife. Nearly every decision below is
some version of that sentence.
## Side by side
| | **MarvinBlade** — remembers | **SpaghetAI** — thinks |
|---|---|---|
| Job | Holds everything, runs everyday services | Runs the AI work |
| Case | Cisco rack server | Dell rack server |
| Memory | 128 GB | **768 GB** |
| Storage | **258 TB** across 30 hard drives | 960 GB of solid-state, no drive array |
| If a drive dies | Covered by two protection drives | Covered by nothing, on purpose |
| Graphics | 1 ordinary card (5 GB) | **2 cards, 40 GB between them** |
| Programs running | 81 | 5 |
| Age | About 8 years | Newer |
Both run Unraid, a Linux built for exactly this kind of pile of mismatched drives. Same
operating system, same era of hardware, opposite design goals.
## The work: MarvinBlade, the machine that remembers
MarvinBlade is an eight-year-old server whose whole job is to hold things and keep
holding them.
It has **258 terabytes of storage spread across 30 hard drives**, with about 117 TB
still free. The drives are a mix of sizes — some 4 TB, most 8 TB, a few 16 TB — which is
normally a problem, because most storage systems want all their drives to match.
Two of the thirty drives are **protection drives**. They don't hold your files; they hold
the arithmetic needed to rebuild the others. Because there are two of them, this machine
can lose **two hard drives at the same time** and still have everything.
That sounds like enough, and for a long time I assumed it was the whole story. It isn't.
I'll come back to that in the section about what actually worries me now.
### What it runs
Eighty-one separate programs live on this machine. The full list is on my
[Home System project page](/projects/home-system/), but grouped, it's:
- **Media** — a streaming library for video and music and photos, so I can watch our
own files from any screen in the house.
- **Records** — a photo library, scanned documents, finances, groceries.
- **One sign-in** — a single login page in front of everything worth protecting, so
there is one place to turn access off.
- **Documents** — a file-sync and office suite that replaces the Google-style tools.
- **Automations** — the plumbing that makes the first four groups talk to each other.
For a while I wanted this machine to also do AI work. It has a basic graphics card in it,
and it can run small models, but it kept hitting the same wall: a model that fits in
memory is a model that runs slowly, and a model big enough to be genuinely useful doesn't
fit. That's what led to the second machine.
## The work: SpaghetAI, the machine that thinks
This is the one people find strange, and I understand why.
SpaghetAI has **768 GB of memory and two graphics cards with 40 GB of their own memory
between them**. It has **no hard drives at all** — just about a terabyte of solid-state
storage for the programs themselves.
And when I looked at it recently, it was **using only 77 of those 768 GB.** That is 10%
of the memory in the machine. So the obvious question is: why buy 768 GB for 77 GB of
work?
### Why 768 GB of memory for 77 GB of work
Back to the kitchen. The counter looks empty, but the counter is empty **because I
already put everything on it.** Nothing is being cooked yet.
Here's what that memory is actually for:
- **The model has to be on the counter already.** An AI model is a very large file. If the
machine has to go fetch it from a drive each time you ask something, an answer that
should take two seconds takes two minutes. So the models are loaded and left there,
waiting. That is most of the 77 GB that is currently used.
- **Long conversations eat memory fast.** Reading one page is cheap. Reading five hundred
pages at once is not, and the cost climbs faster than the page count does. The rest of
the 768 GB is there so the answer to "can you read all of these?" is always yes.
- **Searching across documents wants to be instant.** Finding the passage that answers a
question means holding an index of everything searchable in fast memory. On a hard
drive, that same search is slow enough that you stop doing it.
And here is the number that convinced me the design is right rather than wasteful. At the
same moment that memory showed 10% used, **both graphics cards were nearly full — about
19 of their 20 GB in use each — while doing nothing at all.**
That is the machine at rest. The models are loaded, resident, and waiting. Nothing is
being asked of them. It isn't underused; it is **pre-loaded**.
### What I actually built on top of it
Five programs, which is a much shorter list than the hardware suggests. That's
intentional — one thin layer doing the thinking, and nothing else.
| Program | What it does for me |
|---|---|
| **strata** | The main one. I ask a question in a web page; it searches my documents and answers with sources I can click. |
| **LocalAI_Worker** | A helper that lets the first machine ask this one for help when a job is too big for it. |
| **Docling-Serve** | Turns a PDF or a scan into clean, readable text — the step before anything can be searched. |
| **appapi-harp** | Hooks the AI into the document suite, so the same answers appear where I already work. |
| **open-terminal** | A controlled command line the AI can use, for jobs that aren't document questions. |
The piece I'd point at if you only remember one thing: **the two machines work together as
one AI service.** MarvinBlade already ran the AI program for my chat interface and my
search stack. When SpaghetAI came along, it simply joined that same setup as a helper.
Small and easy jobs still run on the old card; jobs that need real graphics power go to the
new one. **Nothing about the front door changed** — the same search box, the same chat
window. It just got a stronger option behind it.
If you're wondering why the PDF converter matters that much: it's the unglamorous half of
the whole project. Getting a model to answer well is mostly a matter of getting its
reading material into clean text first. Most of my early frustration came from models
giving confident nonsense, and most of that nonsense traced back to a badly converted
document rather than a bad model.
## The outcome
It works. I can open a web page, ask a question in plain English about documents that
exist only inside my house, and get an answer with links back to the pages it came from.
Photos, PDFs, scans, notes. Nothing left my network to do it.
The honest limits, because they matter more than the wins:
- **It is not faster than a cloud service.** My setup is slower than the big commercial
ones, and the models I can run are less capable than the ones I'd use for a hard
reasoning problem. I still use those.
- **Speed comes from the pre-loading, not the hardware.** Warm, it's fine. Cold, it's
slow — and how cold it goes depends entirely on the problem in the next section.
- **It takes upkeep.** Updates break things, and drives die. This is the part people
underestimate when they see the exciting spec sheet.
What I get for that is not speed or capability. It's that the answer is the same one
whether or not I have internet, and the material it read never left the building.
## The mistake I made, and would make again differently
Here is the part this post exists to warn you about.
SpaghetAI has no hard drives. So where do its model files — the multi-gigabyte ones —
live?
**On MarvinBlade.** The AI machine reaches across the network, to the storage machine,
to load its own brain.
```text
MarvinBlade SpaghetAI
┌──────────────────┐ ┌────────────────────┐
│ holds all the │ │ does the thinking │
│ files, and all │◄──────►│ 40 GB of graphics │
│ the model files │ network│ memory, waiting │
└──────────────────┘ └────────────────────┘
▲ ▲
│ │
if this goes down, this can't
everything does start up
```
The consequences, in order of how much they annoy me:
1. **The AI machine cannot start over.** Restart it and it needs a network trip to reload
its models. Fast if the models are already in memory; slow if they aren't.
2. **They fail together.** If MarvinBlade goes down, the AI goes down with it, even
though the expensive half of the AI stack is sitting idle two feet away with its
graphics cards still loaded.
3. **One power problem takes out both.** And that's the thing I actually found.
MarvinBlade's 30 drives don't fit inside the server case. They live in **two separate
drive cabinets** bolted into the rack beside it, connected by cable.
Each cabinet has four power supplies, so it can survive one failing. Right now **two of
the four in each cabinet are dead.** The cabinets still run — they have working supplies
— but the *backup* is gone. A single power event now takes out most of 30 drives and both
protection drives at once. No amount of protection survives that. Meanwhile a parity
check was running the day I looked, which is the system quietly verifying it can still
rebuild a drive.
So the lesson, which I'd give anyone building this: **protection against drive failure is
not the same as protection against everything else.** The thing most likely to take my
setup down isn't a dying disk. It's a power supply, a network cable, or the fact that I
made one machine responsible for the other's ability to think.
Two smaller findings from the same check-up, both cheaper to fix than buying more
capacity: the space holding all the programs is **86% full**, which is how you get an
outage from a log file rather than a dead drive; and a spare drive passed its health
check while quietly reporting two repaired sectors, which is the sort of thing you note
and replace rather than ignore.
## Do this yourself
The useful thing about the design is that it's a *destination*, not a starting point. If
you want to run this kind of thing at home, start far smaller than mine.
**Tier 1 — one normal PC and one decent graphics card.** A machine with 32 GB of memory
and a card with 12 GB of its own will run a genuinely useful model, and it will do
document search over a few thousand files comfortably. This is where you should start.
The software is free, the learning is real, and none of it is wasted if you outgrow the
hardware.
**Tier 2 — a used workstation with 128–256 GB of memory.** This is the step that changes
what you can ask. Bigger models, larger document sets, and services that stay up instead
of being started when needed. Business machines go cheaply secondhand; this is the sweet
spot.
**Tier 3 — split the jobs, which is where I am.** A storage machine and a thinking
machine, once you have enough of both to care about them failing separately.
Two rules of thumb I'd give myself five years ago:
> **Buy memory before you buy storage.** Storage is cheap and easy to add later. Memory is
> the thing that decides what you can run at all.
> **Only build protection for things you would hate to lose.** A media library is not the
> same as scanned documents. Two copies beat one; three beat two, and the difference
> between two and three is where the real cost is.
And one about money, because people get this wrong in both directions: this is not
cheaper than a subscription. The hardware cost real money and the electricity is
measurable. I'm not buying savings. I'm buying the ability to keep my paperwork at home
and have it still be useful.
## What runs this site
This website lives on MarvinBlade as one more program in the eighty-one. I mention it
because I had "hosted on Appwrite" written in various notes for a long time, and it isn't
true any more — it's a plain build served by a web server on the storage box. The site
gets built from source and served, like everything else here. I'd rather say what's
actually running.
## If you take one thing from this
Two machines built for opposite reasons, one pipeline between them. The spec that looks
ridiculous — 768 GB of memory running at 10% — stops looking ridiculous once you notice
the graphics cards are 95% full and idle. The machine isn't wasting money on memory it
doesn't need; it's holding its work in place before the work arrives.
And the number that matters most on either box isn't the storage count or the memory
count. It's the cable between them, because that's the one thing neither machine can
survive alone.
---
*Numbers are as measured on 3 November 2026 and will drift. Capacities are written in
terabytes as the server reports them.*
@@ -1,51 +0,0 @@
---
title: "Astro Sphere: File Structure"
summary: "You'll find these directories and files in the project. What do they do?"
date: "Mar 17 2024"
draft: true
tags:
- Tutorial
- Astro
- Astro Sphere
---
A one line summary of what each file and directory is for:
```js
/
├── public/ // Files publicly available to the browser
│ ├── fonts/ // The default fonts for Astro Sphere
│ │ └── atkinson-bold.woff // default font weight 700
│ │ └── atkinson-regular.woff // default font weight 400
│ ├── js/ // Javascript that will be imported into <head>
│ │ └── animate.js // function for animating page elements
│ │ └── bg.js // function for generating the background
│ │ └── scroll.js // scroll handler for the header styles
│ │ └── theme.js // controls the light and dark theme
│ └── brand.svg //the icon that displays in header and footer
│ └── favicon.svg //the icon that displays in the browser
│ └── ui.svg // an svg sprite for all ui icons on the website
│ └── social.svg // an svg sprite for all social media icons
│ └── open-graph.jpg // the default image for open-graph
│ └── robots.txt // for web crawlers and bots to index the website
├── src/ // Everything that will be built for the website
│ ├── components/ // All astro and SolidJs components
│ ├── content/ // Contains all static markdown to be compiled
│ │ | blog/ // Contains all blog post markdown
│ │ | projects/ // Contains all projects markdown
│ │ | work/ // Contains all work page markdown
│ │ | legal/ // Contains all legal docs markdown
│ │ └── config.ts // Contains the collection config for Astro
│ ├── layouts/ // Reused layouts across the website
│ └── pages/ // All of the pages on the website
│ └── styles/ // CSS and global tailwind styles
│ └── lib/ // Global helper functions
│ └── consts.ts // Page metadata, general configuration
│ └── types.ts // Types for consts.ts
└── .gitignore // Files and directories to be ignored by Git
└── .eslintignore // Files and directories to be ignored by ESLint
└── eslintrc.cjs // ESLint configuration
└── astro.config.mjs // Astro configuration
└── tailwind.config.mjs // Tailwind configuration
└── tsconfig.json // Typescript configuration
└── package.json // All the installed packages
```
@@ -1,90 +0,0 @@
---
title: "Astro Sphere: Getting Started"
summary: "You've downloaded and installed the project. Let's hit the ground running."
date: "Mar 16 2024"
draft: true
tags:
- Tutorial
- Astro
- Astro Sphere
---
Astro Sphere is designed to be configurable. This article will cover the basics on
configuring the site and make it personal.
### First let's change the url
```js
//astro.config.mjs
export default defineConfig({
site: "https://awesome-portfolio.com", // your domain here
integrations: [mdx(), sitemap(), solidJs(), tailwind({ applyBaseStyles: false })],
})
```
### Next, Let's configure the Site
```js
// src/consts.ts
export const SITE: Site = {
TITLE: "Astro Sphere",
DESCRIPTION: "Welcome to Astro Sphere, a portfolio and blog for designers and developers.",
AUTHOR: "Mark Horn",
}
```
| Field | Type | Description |
| :---------- | :----- | :--------------------------------------------------------------------- |
| TITLE | String | The title of the website. Displayed in header and footer. Used in SEO. |
| DESCRIPTION | String | The description of the index page of the website. Used in SEO. |
| AUTHOR | String | Your name. |
### Change the branding
The browser icon is located in `/public/favicon.svg`
The header and footer branding icon is located in `/public/brand.svg` as a sprite with id="brand"
### The rest of the consts file
Each page has a metadata entry that is useful for SEO.
```js
export const WORK: Page = {
TITLE: "Work",
DESCRIPTION: "Places I have worked.",
}
```
The links that are displayed in the header and drawer
```js
export const LINKS: Links = [
{ HREF: "/", TEXT: "Home" },
{ HREF: "/work", TEXT: "Work" },
{ HREF: "/blog", TEXT: "Blog" },
{ HREF: "/projects", TEXT: "Projects" },
]
```
The social media links
```js
export const SOCIALS: Socials = [
{
NAME: "Github",
ICON: "github",
TEXT: "markhorn-dev",
HREF: "https://github.com/markhorn-dev/astro-sphere"
},
]
```
| Field | Type | Required | Description |
| :---- | :--- | :------- | :---------- |
| NAME | string | yes | Accessible name |
| ICON | string | yes | Refers to the symbol id in `public/social.svg` |
| TEXT | string | yes | Shorthand profile name |
| HREF | string | yes | The link to the social media profile |
@@ -1,87 +0,0 @@
---
title: "Astro Sphere: Adding a new post or project."
summary: "Adding a new article (blog post or project) is pretty easy."
date: "Mar 14 2024"
draft: true
tags:
- Tutorial
- Astro
- Astro Sphere
---
### Basics
Create a folder in the respective collection you wish to create content. The name of the folder will be the slug in which your content will be found.
```text
creating the following
/content/blog/my-new-post/index.md
will be published to
https://yourdomain.com/blog/my-new-post
```
### Frontmatter
Front matter is in yaml if you are familiar with the format. All posts and projects require frontmatter at the top of the document to be imported. All frontmatter must be inside triple dashes, similar to Astro format. See example below.
### Blog Collection
| Field | Type | Req? | Description |
| :------ | :------ | :--- | :------------------------------------------------------------ |
| title | string | yes | Title of the post. Used in SEO. |
| summary | string | yes | Short description of the post. Used in SEO. |
| date | string | yes | Any string date that javascript can convert. Used in sorting |
| tags | array | yes | Post topic. Array of strings. Used in filtering. |
| draft | boolean | no | Hides the post from collections. Unpublished entry. |
Example blog post frontmatter
```yaml
---
title: "Astro Sphere: Adding a new post or project."
summary: "Adding a new article (blog post or project) is pretty easy."
date: "Mar 18 2024"
draft: false
tags:
- Tutorial
- Astro
- Astro Sphere
---
```
### Projects Collection (extends Blog Collection)
| Field | Type | Req? | Description |
| :------ | :------ | :--- | :------------------------------------------------------------ |
| title | string | yes | Title of the post. Used in SEO. |
| summary | string | yes | Short description of the post. Used in SEO. |
| date | string | yes | Any string date that javascript can convert. Used in sorting |
| tags | array | yes | Post topic. Array of strings. Used in filtering. |
| draft | boolean | no | Hides the post from collections. Unpublished entry. |
| demoUrl | string | no | A link to the deployed project, if applicable. |
| repoUrl | string | no | A link to the repository, if applicable. |
Example project frontmatter
```yaml
---
title: "Astro Sphere"
summary: "Astro Sphere, a portfolio and blog for designers and developers."
date: "Mar 18 2024"
draft: false
tags:
- Astro
- Typescript
- Javascript
- Tailwind
- SolidJS
demoUrl: https://astro-sphere.vercel.app
repoUrl: https://github.com/markhorn-dev/astro-sphere
---
```
### Write your content
You've made it this far, all that is left to do is write your content beneath the frontmatter. Writing markdown will be covered in the next article.
@@ -1,236 +0,0 @@
---
title: "Astro Sphere: Writing Markdown"
summary: "Basic Markdown syntax that can be used when writing Markdown content in Astro Sphere."
date: "Mar 13 2024"
draft: true
tags:
- Tutorial
- Astro
- Astro Sphere
- Markdown
---
### Headings
```text
# H1
## H2
### H3
#### H4
##### H5
###### H6
```
# H1
## H2
### H3
#### H4
##### H5
###### H6
### Paragraph
Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur, offic to cor sequas etum rerum idem sintibus eiur? Quianimin porecus evelectur, cum que nis nust voloribus ratem aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos evelece arcillit ut aut eos eos nus, sin conecerem erum fuga. Ri oditatquam, ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate dolores editium rerore eost, temped molorro ratiae volorro te reribus dolorer sperchicium faceata tiustia prat.
Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat.
### Images
Relative image in the /public folder
```markdown
![blog placeholder](/open-graph.jpg)
```
![blog placeholder](/open-graph.jpg)
Relative Image in the same folder as the markdown
```markdown
![Test Relative Image](./spongebob.png)
```
![Test Relative Image](./spongebob.png)
## Blockquotes
The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a `footer` or `cite` element, and optionally with in-line changes such as annotations and abbreviations.
### Blockquote without attribution
#### Syntax
```markdown
> Tiam, ad mint andaepu dandae nostion secatur sequo quae.
> **Note** that you can use _Markdown syntax_ within a blockquote.
```
#### Output
> Tiam, ad mint andaepu dandae nostion secatur sequo quae.
> **Note** that you can use _Markdown syntax_ within a blockquote.
### Blockquote with attribution
#### Syntax
```markdown
> Don't communicate by sharing memory, share memory by communicating.<br>
> — <cite>Rob Pike[^1]</cite>
```
#### Output
> Don't communicate by sharing memory, share memory by communicating.<br>
> — <cite>Rob Pike[^1]</cite>
[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015.
## Tables
#### Syntax
```markdown
| Italics | Bold | Code |
| --------- | -------- | ------ |
| _italics_ | **bold** | `code` |
```
#### Output
| Italics | Bold | Code |
| --------- | -------- | ------ |
| _italics_ | **bold** | `code` |
## Code Blocks
#### Syntax
we can use 3 backticks ``` in new line and write snippet and close with 3 backticks on new line and to highlight language specific syntac, write one word of language name after first 3 backticks, for eg. html, javascript, css, markdown, typescript, txt, bash
````markdown
```html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Example HTML5 Document</title>
</head>
<body>
<p>Test</p>
</body>
</html>
```
````
Output
```html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Example HTML5 Document</title>
</head>
<body>
<p>Test</p>
</body>
</html>
```
## List Types
### Ordered List
#### Syntax
```markdown
1. First item
2. Second item
3. Third item
```
#### Output
1. First item
2. Second item
3. Third item
### Unordered List
#### Syntax
```markdown
- List item
- Another item
- And another item
```
#### Output
- List item
- Another item
- And another item
### Nested list
#### Syntax
```markdown
- Fruit
- Apple
- Orange
- Banana
- Dairy
- Milk
- Cheese
```
#### Output
- Fruit
- Apple
- Orange
- Banana
- Dairy
- Milk
- Cheese
## Other Elements — abbr, sub, sup, kbd, mark
#### Syntax
```markdown
<abbr title="Graphics Interchange Format">GIF</abbr> is a bitmap image format.
H<sub>2</sub>O
X<sup>n</sup> + Y<sup>n</sup> = Z<sup>n</sup>
Press <kbd><kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>Delete</kbd></kbd> to end the session.
Most <mark>salamanders</mark> are nocturnal, and hunt for insects, worms, and other small creatures.
```
#### Output
<abbr title="Graphics Interchange Format">GIF</abbr> is a bitmap image format.
H<sub>2</sub>O
X<sup>n</sup> + Y<sup>n</sup> = Z<sup>n</sup>
Press <kbd><kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>Delete</kbd></kbd> to end the session.
Most <mark>salamanders</mark> are nocturnal, and hunt for insects, worms, and other small creatures.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

@@ -1,16 +0,0 @@
---
type Props = {
name: string
}
const { name } = Astro.props
---
<div class="border p-4 bg-yellow-100 text-black">
<div>
Hello,
<span class="font-semibold">
{name}!!!
</span>
</div>
<slot/>
</div>
@@ -1,53 +0,0 @@
---
title: "Astro Sphere: Writing MDX"
summary: "Lorem ipsum dolor sit amet"
date: "Mar 12 2024"
draft: true
tags:
- Tutorial
- Astro
- Astro Sphere
- Markdown
- MDX
---
MDX is a special flavor of Markdown that supports embedded JavaScript & JSX syntax. This unlocks the ability to [mix JavaScript and UI Components into your Markdown content](https://docs.astro.build/en/guides/markdown-content/#mdx-features) for things like interactive charts or alerts.
If you have existing content authored in MDX, this integration will hopefully make migrating to Astro a breeze.
## An astro component with props
```
// Imported from relative path (same dir as markdown file)
import MyComponent from "./MyComponent.astro"
<MyComponent name="You">
Welcome to MDX
</MyComponent>
```
import MyComponent from "./MyComponent.astro"
<MyComponent name="You">
Welcome to MDX
</MyComponent>
## An interactive Solid Js component
```
// Imported from components directory (src/components)
import MyComponent from "@components/Counter"
// Don't forget the astro client:load directive
<Counter client:load />
```
import Counter from "@components/Counter"
<Counter client:load />
<br/>
<br/>
<br/>
@@ -1,54 +0,0 @@
---
title: "Astro Sphere: Social media links"
summary: "A quick tutorial on how to change, add or remove social media links"
date: "Mar 11 2024"
draft: true
tags:
- Tutorial
- Astro
- Astro Sphere
---
Astro Sphere comes preconfigured with social media links for Email, Github, Linked In and Twitter (X), but it's very easy to add more.
### Edit `consts.ts`
```js
// consts.ts
export const SOCIALS: Socials = [
{
NAME: "Github",
ICON: "github",
TEXT: "markhorn-dev",
HREF: "https://github.com/markhorn-dev/astro-sphere"
},
]
```
| Field | Type | Required | Description |
| :---- | :--- | :------- | :---------- |
| NAME | string | yes | Accessible name |
| ICON | string | yes | Refers to the symbol id in `public/social.svg` |
| TEXT | string | yes | Shorthand profile name |
| HREF | string | yes | The link to the social media profile |
### Edit /public/social.svg
Simply add your own symbols to the svg sprite.
It is recommended that all styles be removed from new symbols added, or they may not show up correctly or conflict with Tailwind's classes.
The id should match the icon field as specified in your `consts.ts` file.
```html
<!-- public/social.svg -->
<svg xmlns="http://www.w3.org/2000/svg">
<defs>
<symbol id="github" viewBox="0 0 496 512">
<path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3 .3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5 .3-6.2 2.3zm44.2-1.7c-2.9 .7-4.9 2.6-4.6 4.9 .3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3 .7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3 .3 2.9 2.3 3.9 1.6 1 3.6 .7 4.3-.7 .7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3 .7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3 .7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"/>
</symbol>
</defs>
</svg>
```
-45
View File
@@ -1,45 +0,0 @@
import { defineCollection, z } from "astro:content"
const work = defineCollection({
type: "content",
schema: z.object({
company: z.string(),
role: z.string(),
dateStart: z.coerce.date(),
dateEnd: z.union([z.coerce.date(), z.string()]),
}),
})
const blog = defineCollection({
type: "content",
schema: z.object({
title: z.string(),
summary: z.string(),
date: z.coerce.date(),
tags: z.array(z.string()),
draft: z.boolean().optional(),
}),
})
const projects = defineCollection({
type: "content",
schema: z.object({
title: z.string(),
summary: z.string(),
date: z.coerce.date(),
tags: z.array(z.string()),
draft: z.boolean().optional(),
demoUrl: z.string().optional(),
repoUrl: z.string().optional(),
}),
})
const legal = defineCollection({
type: "content",
schema: z.object({
title: z.string(),
date: z.coerce.date(),
}),
})
export const collections = { work, blog, projects, legal }
+45
View File
@@ -0,0 +1,45 @@
---
title: "Privacy Policy"
date: 2025-08-01
---
This Privacy Policy explains how we collect, use, and protect your personal information when you visit our website.
## Information We Collect
We may collect the following types of information:
- **Personal Information**: Name, email address, and other contact details you provide when subscribing to our newsletter or contacting us.
- **Usage Data**: Information about how you use our website, including pages visited, time spent, and click patterns.
- **Device Information**: Details about your device, including browser type, operating system, and IP address.
## How We Use Your Information
We use the information we collect to:
- Provide and improve our website and services
- Respond to your inquiries and requests
- Send you newsletters and updates (with your consent)
- Analyze website usage and performance
- Comply with legal obligations
## Cookies
We use cookies and similar tracking technologies to enhance your experience. You can control cookies through your browser settings.
## Third-Party Services
We may use third-party services that collect information separately. This privacy policy does not apply to those services.
## Your Rights
You have the right to:
- Access your personal information
- Request corrections or updates
- Request deletion of your information
- Opt out of marketing communications
## Contact Us
If you have questions about this privacy policy, please contact us at privacy@spaghet.io.
-55
View File
@@ -1,55 +0,0 @@
---
title: "Privacy Policy"
date: "08/13/2025"
---
This Privacy Policy describes how Spaghet Tech collects, uses, and protects your personal information when you use our website (https://spaghet.tech).
#### Information We Collect
When you visit our website, we may collect the following types of information:
**Non-personal Identification Information**
- Browser type and version
- Operating system
- Referring web page
- Date and time of access
- IP address (in some cases)
**Personal Identification Information**
We do not currently collect personal identification information from website visitors unless you voluntarily provide it to us through contact forms or other communication methods.
#### How We Use Your Information
We use the collected information for:
- Analyzing usage patterns to improve our website
- Enhancing user experience
- Responding to your inquiries
- Providing information about our services
#### How We Protect Your Information
We implement appropriate security measures to protect against unauthorized access to or alteration of your personal information. These include:
- Secure server technology
- Regular security updates
- Access controls and authentication
#### Sharing Your Information
We do not sell, trade, or rent your personal information to others. We may share information with trusted third parties who assist us in operating our website, conducting our business, or serving our users, so long as those parties agree to keep this information confidential.
#### Cookies
Our website uses cookies to enhance user experience and analyze site usage. You can control cookie settings through your browser preferences.
#### Third-Party Links
Our website may contain links to third-party websites. We are not responsible for the privacy practices or content of these sites.
#### Changes to This Privacy Policy
We may update our Privacy Policy from time to time. We will notify you of any changes by posting the new policy on this page with an updated effective date.
#### Contact Us
If you have any questions about this Privacy Policy, please contact us at quinn@spaghet.tech.
+38
View File
@@ -0,0 +1,38 @@
---
title: "Terms of Service"
date: 2025-08-01
---
These Terms of Service govern your use of our website and services.
## Acceptance of Terms
By accessing or using our website, you agree to be bound by these Terms of Service.
## Use of Website
You may use our website for personal, non-commercial purposes. You agree not to:
- Modify or copy any part of the website
- Use the website for any unlawful purpose
- Interfere with the proper working of the website
## Content
All content on our website, including text, graphics, and images, is our property and is protected by intellectual property laws.
## Disclaimer
Our website and content are provided "as is" without warranties of any kind. We do not warrant that the website will be error-free or uninterrupted.
## Limitation of Liability
We shall not be liable for any damages arising from your use of our website, including direct, indirect, or consequential damages.
## Changes to Terms
We reserve the right to modify these Terms of Service at any time. Your continued use of the website constitutes acceptance of any changes.
## Contact Us
If you have questions about these terms, please contact us at legal@spaghet.io.
-46
View File
@@ -1,46 +0,0 @@
---
title: "Terms of Use"
date: "08/13/2025"
---
Please read these Terms of Use ("Terms", "Terms of Use") carefully before using the https://spaghet.tech website (the "Service") operated by Spaghet Tech ("us", "we", or "our").
#### Agreement to Terms
By accessing or using our website, you agree to be bound by these Terms of Use and all applicable laws and regulations. If you disagree with any part of these terms, you must not access the website.
#### Intellectual Property Rights
All content on this website, including text, graphics, logos, images, and software, is the property of Spaghet Tech or its licensors and is protected by intellectual property laws.
#### User Representations
By using our website, you represent that you are at least 18 years old and have the legal capacity to enter into these terms.
#### Use of Services
You may use our website for personal informational purposes only. You agree not to:
- Use the website for any unlawful purpose
- Interfere with or disrupt the website's operation
- Attempt to gain unauthorized access to our systems
- Use automated means (bots, scrapers) to access the site
#### Links to Other Websites
Our website may contain links to third-party websites. We do not endorse or assume any responsibility for the content, privacy policies, or practices of these sites.
#### Termination
We may terminate or suspend your access to our website immediately, without prior notice, if you violate these Terms of Use.
#### Governing Law
These terms shall be governed by and construed in accordance with the laws of Ohio, United States, without regard to its conflict of law provisions.
#### Changes to These Terms of Use
We may update our Terms of Use from time to time. We will notify you of any changes by posting the new terms on this page with an updated effective date.
#### Contact Us
If you have any questions about these Terms of Use, please contact us at quinn@spaghet.tech.
-25
View File
@@ -1,25 +0,0 @@
---
title: "Appwrite Integration"
summary: "Custom Appwrite implementation for backend services"
date: "Aug 2025"
draft: false
tags:
- Appwrite
- Backend
- Authentication
- Database
- API
demoUrl: https://appdev.spaghet.io/
---
Implementation of Appwrite as a backend solution for modern web applications. This project demonstrates the integration of Appwrite's comprehensive backend services including authentication, database management, file storage, and cloud functions.
Key features include:
- User authentication and authorization using Appwrite's built-in authentication system
- Database management with support for multiple document collections
- File storage and management capabilities
- Serverless functions for custom business logic
- Real-time database updates and notifications
- RESTful API integration for frontend applications
The project showcases my ability to leverage modern backend-as-a-service platforms to build scalable, secure, and maintainable applications while reducing infrastructure overhead.
@@ -1,16 +1,11 @@
---
title: "Astro Profile"
summary: "Personal portfolio website built with Astro, React, and Tailwind CSS"
date: "Aug 2025"
date: 2025-08-01
tags: ["Astro", "React", "Tailwind CSS", "JavaScript", "TypeScript"]
draft: false
tags:
- Astro
- React
- Tailwind CSS
- JavaScript
- TypeScript
demoUrl: https://home.spaghet.io
repoUrl: https://github.com/spaghetgaming/Spaghet.io
demoUrl: "https://spaghet.io"
repoUrl: "https://github.com/spaghetgaming/astro-profile"
---
A modern personal portfolio website showcasing my work, projects, and technical expertise. Built with Astro for optimal performance and SEO, utilizing React components for interactive elements, and styled with Tailwind CSS for responsive design.
@@ -24,4 +19,4 @@ Features include:
- Contact form with email integration
- SEO optimization for better search engine visibility
The site demonstrates my proficiency in modern web development practices and technologies, including component-based architecture, responsive design principles, and performance optimization techniques.
The site demonstrates my proficiency in modern web development practices and technologies, including component-based architecture, responsive design principles, and performance optimization techniques.
@@ -1,15 +1,10 @@
---
title: "Gitea Implementation"
summary: "Self-hosted Git service with continuous integration capabilities"
date: "Aug 2025"
date: 2025-08-01
tags: ["Git", "Gitea", "CI/CD", "Docker", "DevOps"]
draft: false
tags:
- Gitea
- Git
- CI/CD
- DevOps
- Docker
demoUrl: https://gitea.spaghet.io
demoUrl: "https://gitea.spaghet.io"
---
Deployment and configuration of Gitea as a self-hosted Git service for version control and continuous integration. This implementation provides a comprehensive solution for managing code repositories, tracking issues, and automating development workflows.
@@ -23,4 +18,4 @@ Key features include:
- Customizable webhooks and automation scripts
- Backup and disaster recovery procedures
The project demonstrates my expertise in DevOps practices, infrastructure management, and the implementation of self-hosted solutions that provide greater control and security over development processes.
The project demonstrates my expertise in DevOps practices, infrastructure management, and the implementation of self-hosted solutions that provide greater control and security over development processes.
+93
View File
@@ -0,0 +1,93 @@
---
title: "Home System"
summary: "Technology as Lifestyle — two Unraid servers: 258 TB of dual-parity storage and a 768 GB / 40 GB-VRAM GPU inference box running 86 containers between them."
date: 2026-11-03
tags: ["DevOps", "Docker", "Unraid", "Homelab", "NVIDIA", "LocalAI", "RAG", "Authentik", "PostgreSQL", "MariaDB", "MySQL", "MongoDB", "Redis", "Minio", "Plex", "Nextcloud", "n8n", "Node-RED", "KVM"]
draft: false
---
Two Unraid 7.3.0 hosts, designed to fail differently. MarvinBlade is the storage and
application layer — capacity and availability. SpaghetAI is the inference layer — memory
and VRAM, with no array at all. The plain-language version of this, with the
reasoning and the mistakes, is the blog post
[Running AI From My Own Computers](/blog/04-marvinblade-and-spaghetai/).
## The two boxes
| | **MarvinBlade** | **SpaghetAI** |
|---|---|---|
| Role | Primary storage + application server | GPU / AI inference server |
| Chassis | Cisco UCS C220 M4S | Dell PowerEdge R740 |
| CPU | 2× Xeon E5-2683 v4 — 32 cores / 64 threads | 2× Xeon Silver 4214 — 24 cores / 48 threads |
| RAM | 128 GB DDR4 ECC | 768 GB DDR4 ECC (22× 32 GB RDIMM) |
| GPU | 1× Quadro P2000 (5 GB) | 2× RTX A4500 (40 GB total VRAM) |
| Storage | 258 TB raw across 30 array disks, 117 TB free | 960 GB btrfs SSD pool, no array |
| Parity | 2× 16 TB — survives two simultaneous disk failures | none, by design |
| Filesystem | XFS throughout | btrfs |
| Containers | 81 | 5 |
| VMs | 2 — Home Assistant, Windows Server 2025 | none |
MarvinBlade's 30 spindles live in two NetApp DS424IOM6 24-bay SAS shelves chained over
QSFP+. Cache and hot-tier SSDs sit outside the array: 1 TB cache pool, 2 TB media pool,
and a 720 GB Docker vDisk pool.
## What runs on them
| Category | Services |
|---|---|
| **Media** | Plex, Audiobookshelf, Immich (+ CUDA ML worker), Romm, Owncast, Sonarr, Radarr, Prowlarr, tdarr, SABnzbd, Deluge, Ombi |
| **Databases** | PostgreSQL 17, PostgreSQL 17 + pgvector, MariaDB, MySQL, MongoDB 7.0, Redis, Qdrant |
| **Identity & security** | Authentik (SSO + LDAP outpost), oauth2-proxy, Anubis, Vaultwarden, OpenBao, Pi-hole |
| **Web & collaboration** | NGINX Proxy Manager, Nextcloud (Talk HPB, Whiteboard), Collabora CODE, OnlyOffice, DocuSeal, Reactive Resume, Gitea, spaghet-home |
| **Automation & AI** | n8n (+ sandbox), Windmill, Node-RED, Open WebUI, LocalAI, strata, Docling-Serve, Morphic, SearXNG, Open Terminal |
| **Gaming** | Crafty (Minecraft control panel), mcpelevator, Virtual Tabletop |
| **Observability** | Splunk, Uptime Kuma, GoAccess, Notifiarr, autoheal |
Authentik fronts every service that matters, with oauth2-proxy and Anubis handling the
apps that can't speak OIDC natively.
## SpaghetAI — the inference layer
Five containers, ~139 GB of RAM between them, both A4500s holding ~19 GB of resident
weights each.
| Container | What it does | RAM |
|---|---|---|
| **strata** | RAG / document-search app (CUDA 13 build), port 8280 | 126 GB |
| **LocalAI_Worker** | Distributed LocalAI worker node, gRPC 50050–50060 | 4.6 GB |
| **Docling-Serve** | Document → Markdown/JSON parsing API, port 5001 | 4.5 GB |
| **appapi-harp** | Nextcloud App API companion | 0.16 GB |
| **open-terminal** | AI-accessible shell, port 8973 | 0.16 GB |
LocalAI runs in distributed mode: MarvinBlade hosts the orchestrator and the general
CPU/Quadro inference, SpaghetAI joins as a GPU worker over gRPC, so heavier models get
scheduled onto the A4500s without changing anything at the front door.
## The dependency between them
SpaghetAI has no array. Its model weights live on MarvinBlade, mounted over SMB from the
`local_ai` share (a 2 TB cache-exclusive pool on a Crucial MX500).
That makes MarvinBlade a single point of failure for SpaghetAI's cold starts and model
swaps — the GPU box can't serve anything it hasn't already loaded if the storage box
goes down. The fix on the list is a local NVMe mirror of the hot weights so the inference
path has its own fault boundary.
## Failure domains
Dual parity protects against two disks dying at once, which is not the most likely way
to lose the array. Power to a shelf is. Both SAS shelves have lost PSU redundancy, and
the array depends on that network hop between the two boxes. Durability here is a chain —
disks, parity, shelf power, SMB — and the parity is the strongest link in it.
## Day-to-day operations
- End-to-end support for 30+ users across the containerized applications, including
troubleshooting, configuration guidance and documentation.
- On-call for critical services, with Uptime Kuma and Splunk providing the signal.
- DevOps workflows automated through n8n, Windmill, Node-RED, custom APIs and Gitea
Actions — this site itself builds and deploys through the pipeline.
- Backup strategy layered on the dual-parity array, with separate `backup` share and
off-array copies.
Specs above were measured from live telemetry on 3 November 2026 and will drift.
-32
View File
@@ -1,32 +0,0 @@
---
title: "Home System"
summary: "Technology as Lifestyle - Personal Docker ecosystem with 2 Unraid servers"
date: "Aug 2025"
draft: false
tags:
- Docker
- Unraid
- PostgreSQL
- MariaDB
- MongoDB
- Redis
- Minio
- Kubernetes
- Node-RED
- Authentik
- LDAP
---
Designed and maintained a scalable Docker container ecosystem supporting PostgreSQL, MariaDB, MySQL, MongoDB, Redis, and Minio for high-availability applications, ensuring robust data storage, caching, and object storage solutions.
Configured and secured authentication frameworks using Authentik, Vaultwarden, and LDAP integration, implementing zero-trust security models and access control for internal and external systems.
Deployed and supported proxy and API gateway solutions to enable secure, scalable, and customizable network infrastructure for internal and external applications.
Provided end-to-end support for 30+ users utilizing the containerized applications, including troubleshooting, configuration guidance, and documentation for tools like Zammad, and Immich.
Streamlined DevOps workflows with Node-RED, custom APIs, and automation scripts, enhancing productivity for both personal and team projects.
Maintained and optimized containerized tools for personal and organizational use, ensuring reliability, performance, and user-friendly interfaces.
Handled on-call duties for critical applications, resolving issues and minimizing downtime for users relying on the containerized ecosystem.
@@ -1,8 +1,8 @@
---
title: "Spaghet.io Website"
date: 2025-08-13
summary: "A comprehensive overview of the Spaghet.io personal website, detailing its features, design elements, and technical implementation."
tags: [website, portfolio, personal, astro, spaghetti]
date: 2025-08-13
tags: ["website", "portfolio", "personal", "astro", "spaghetti"]
draft: false
---
@@ -22,7 +22,7 @@ The website features a fully responsive design that works seamlessly across:
### 2. Dark Mode Support
**Dual Theme Implementation:**
Dual Theme Implementation:
- Light mode with warm, spaghetti-themed colors
- Dark mode with complementary dark theme that maintains visual consistency
- Smooth transitions between themes
@@ -31,10 +31,10 @@ The website features a fully responsive design that works seamlessly across:
### 3. Spaghetti-Themed Color Palette
**Primary Colors:**
- **Spaghetti Yellow**: `#FDE68A` - Used for highlights and interactive elements
- **Spaghetti Red**: `#FECACA` - Used for accents and important actions
- **Spaghetti Cream**: `#FEF3C7` - Used for backgrounds and subtle elements
- **Spaghetti Brown**: `#78350F` - Used for text content and primary elements
- Spaghetti Yellow: #FDE68A - Used for highlights and interactive elements
- Spaghetti Red: #FECACA - Used for accents and important actions
- Spaghetti Cream: #FEF3C7 - Used for backgrounds and subtle elements
- Spaghetti Brown: #78350F - Used for text content and primary elements
### 4. Interactive UI Components
@@ -53,11 +53,11 @@ The website features a fully responsive design that works seamlessly across:
### 5. Technical Implementation
**Built With:**
- **Astro**: Static site generator for optimal performance
- **SolidJS**: For reactive UI components
- **Tailwind CSS**: Utility-first CSS framework
- **TypeScript**: Type safety and enhanced development experience
- **Markdown**: Content management system
- Astro: Static site generator for optimal performance
- SolidJS: For reactive UI components
- Tailwind CSS: Utility-first CSS framework
- TypeScript: Type safety and enhanced development experience
- Markdown: Content management system
### 6. Performance Optimizations
@@ -89,7 +89,7 @@ The website features a fully responsive design that works seamlessly across:
- Card-based layout with hover effects
- Date formatting and categorization
### Projects Section
### Projects Section
- Project showcase with filtering capabilities
- Tag-based organization system
- Responsive grid layout
@@ -104,6 +104,7 @@ The website features a fully responsive design that works seamlessly across:
## Design Elements
### Visual Theme
The website maintains a consistent spaghetti theme throughout:
- Warm color scheme that evokes feelings of comfort and satisfaction
- Clean, organized layout that mirrors the structure of good spaghetti
@@ -111,12 +112,14 @@ The website maintains a consistent spaghetti theme throughout:
- Proper contrast ratios for accessibility
### Typography
- Clear hierarchy with appropriate font weights
- Responsive text sizing
- Consistent spacing and alignment
- Readable fonts optimized for both light and dark modes
### Layout Structure
- Grid-based responsive layout
- Consistent padding and margins
- Visual balance across all sections
@@ -125,16 +128,18 @@ The website maintains a consistent spaghetti theme throughout:
## Technical Architecture
### Component Structure
The site uses a modular component architecture:
- **Header** - Navigation and branding
- **Footer** - Site information and links
- **Blog** - Content display with filtering
- **Projects** - Portfolio showcase
- **ArrowCard** - Generic card component for content
- **StackCard** - Technology stack display
- **Search** - Search functionality
- Header - Navigation and branding
- Footer - Site information and links
- Blog - Content display with filtering
- Projects - Portfolio showcase
- ArrowCard - Generic card component for content
- StackCard - Technology stack display
- Search - Search functionality
### Theme System
The theme system supports:
- CSS variables for consistent color management
- Dark mode detection and switching
@@ -142,6 +147,7 @@ The theme system supports:
- Smooth transitions between themes
### Content Management
Content is managed through:
- Markdown files for blog posts and projects
- Astro's content collections
@@ -156,7 +162,7 @@ Content is managed through:
- Collapsible sections for smaller screens
- Performance optimized for mobile devices
### Tablet Experience
### Tablet Experience
- Adaptive layout adjustments
- Intermediate view sizes
- Maintained usability across screen sizes
@@ -178,15 +184,15 @@ The website includes accessibility features:
## Future Enhancements
Potential future improvements include:
1. Enhanced animation system with more sophisticated transitions
2. Additional interactive elements that reflect the spaghetti theme
3. More advanced filtering and search capabilities
4. Integration with external APIs for dynamic content
5. Expanded multimedia presentation options
6. Improved social sharing features
- Enhanced animation system with more sophisticated transitions
- Additional interactive elements that reflect the spaghetti theme
- More advanced filtering and search capabilities
- Integration with external APIs for dynamic content
- Expanded multimedia presentation options
- Improved social sharing features
## Conclusion
Spaghet.io represents a cohesive blend of technical excellence and thematic consistency. The site successfully combines modern web technologies with a playful yet professional spaghetti-themed aesthetic to create an engaging user experience that reflects my passion for both technology and culinary arts.
The implementation maintains the structure and organization that makes good spaghetti satisfying to use, while providing an enjoyable browsing experience across all devices and themes.
The implementation maintains the structure and organization that makes good spaghetti satisfying to use, while providing an enjoyable browsing experience across all devices and themes.
@@ -1,16 +0,0 @@
---
title: "Project One"
summary: "Lorem ipsum dolor sit amet"
date: "Mar 18 2022"
draft: true
tags:
- Astro
- Javascript
- Typescript
- Tailwind
- SolidJs
demoUrl: https://astro-sphere-demo.vercel.app
repoUrl: https://github.com/markhorn-dev/astro-sphere
---
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo viverra. Adipiscing enim eu turpis egestas pretium. Euismod elementum nisi quis eleifend quam adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus et malesuada fames ac turpis egestas. Eget magna fermentum iaculis eu non diam phasellus vestibulum lorem. Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet.
@@ -1,15 +0,0 @@
---
title: "Project Two"
summary: "Lorem ipsum dolor sit amet"
date: "Mar 17 2022"
draft: true
tags:
- Svelte
- Sveltekit
- Typescript
- Tailwind
---
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo viverra. Adipiscing enim eu turpis egestas pretium. Euismod elementum nisi quis eleifend quam adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus et malesuada fames ac turpis egestas. Eget magna fermentum iaculis eu non diam phasellus vestibulum lorem. Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo viverra. Adipiscing enim eu turpis egestas pretium. Euismod elementum nisi quis eleifend quam adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus et malesuada fames ac turpis egestas. Eget magna fermentum iaculis eu non diam phasellus vestibulum lorem. Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet.
@@ -1,12 +0,0 @@
---
title: "Project Three"
summary: "Lorem ipsum dolor sit amet"
date: "Mar 16 2022"
draft: true
tags:
- Vue
- Javascript
- Tailwind
---
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo viverra. Adipiscing enim eu turpis egestas pretium. Euismod elementum nisi quis eleifend quam adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus et malesuada fames ac turpis egestas. Eget magna fermentum iaculis eu non diam phasellus vestibulum lorem. Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet.
@@ -1,31 +0,0 @@
---
title: "Project Four"
summary: "Lorem ipsum dolor sit amet"
date: "Mar 15 2022"
draft: true
tags:
- React
- Javascript
- StyleX
---
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo viverra. Adipiscing enim eu turpis egestas pretium.
Euismod elementum nisi quis eleifend quam adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus et malesuada fames ac turpis egestas.
Eget magna fermentum iaculis eu non diam phasellus vestibulum lorem.
Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo viverra. Adipiscing enim eu turpis egestas pretium.
Euismod elementum nisi quis eleifend quam adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus et malesuada fames ac turpis egestas.
Eget magna fermentum iaculis eu non diam phasellus vestibulum lorem.
Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo viverra. Adipiscing enim eu turpis egestas pretium.
Euismod elementum nisi quis eleifend quam adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus et malesuada fames ac turpis egestas.
Eget magna fermentum iaculis eu non diam phasellus vestibulum lorem.
Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet.
@@ -1,8 +1,8 @@
---
company: "Spaghet Tech"
role: "Creator"
dateStart: "05/01/2023"
dateEnd: ""
dateStart: 2023-05-01
dateEnd: 2026-10-14
---
Deep knowledge of ITSM (e.g., INC, PRB, CHG, ESC, etc.), ITOM (e.g., CMDB, ACC, CertDisc, etc.), and ITAM (e.g., SAM, HAM) to position myself as a trusted advisor.
@@ -19,4 +19,4 @@ Ability to coordinate cross-functional teams, manage timelines, and ensure succe
Quick thinking to address challenges like data replication gaps, integration hurdles, or user support needs for 30+ users, while maintaining system reliability.
Strong customer service skills to provide ongoing support, troubleshoot issues, and retain clients (e.g., maintaining 30+ user satisfaction through proactive documentation and on-call maintenance).
Strong customer service skills to provide ongoing support, troubleshoot issues, and retain clients (e.g., maintaining 30+ user satisfaction through proactive documentation and on-call maintenance).
@@ -1,8 +1,8 @@
---
company: "Clear Skye"
role: "Technical Architect"
dateStart: "03/01/2022"
dateEnd: "05/01/2023"
dateStart: 2022-03-01
dateEnd: 2023-05-01
---
Proficient in ServiceNow Identity Governance modules (e.g., IdentityIQ, ClearSkye IGA) for designing, configuring, and optimizing workflows for access management, entitlements, and compliance.
@@ -19,4 +19,4 @@ Expertise in designing data privacy frameworks, managing user data lifecycle, an
Proven ability to collaborate with IT ops, security teams, and business stakeholders to translate governance requirements into technical solutions.
Ability to resolve complex IGA challenges (e.g., entitlement conflicts, access delays) and adapt architectures to evolving compliance, user, and tech trends.
Ability to resolve complex IGA challenges (e.g., entitlement conflicts, access delays) and adapt architectures to evolving compliance, user, and tech trends.
@@ -1,8 +1,8 @@
---
company: "Neoteric Technologies"
role: "Sr. Cloud Architect"
dateStart: "03/01/2021"
dateEnd: "01/01/2022"
dateStart: 2021-03-01
dateEnd: 2022-01-01
---
Results-driven technical leader with deep expertise in cloud architecture and infrastructure design.
@@ -15,4 +15,4 @@ Skilled in automating deployment pipelines and implementing Infrastructure as Co
Experience with monitoring tools to ensure reliable system updates and performance optimization.
Knowledge of security frameworks and compliance standards to design secure cloud solutions.
Knowledge of security frameworks and compliance standards to design secure cloud solutions.
@@ -1,8 +1,8 @@
---
company: "Computer Aid, Inc."
role: "Technical Consultant"
dateStart: "07/01/2019"
dateEnd: "07/01/2021"
dateStart: 2019-07-01
dateEnd: 2021-07-01
---
Technical Consultant for ServiceNow practice with expertise in IT Service Management platforms.
@@ -11,4 +11,4 @@ Deep knowledge of ITSM (e.g., INC, PRG, CHG, ESC) and related frameworks to supp
Experience in implementing and optimizing ServiceNow solutions for various business needs.
Strong ability to translate technical requirements into business value for clients.
Strong ability to translate technical requirements into business value for clients.
@@ -1,8 +1,8 @@
---
company: "TriMedx"
role: "Senior Software Engineer"
dateStart: "09/01/2017"
dateEnd: "07/01/2019"
dateStart: 2017-09-01
dateEnd: 2019-07-01
---
Experienced software engineer with focus on delivering fast, elegant code along with delightful user interfaces.
@@ -11,4 +11,4 @@ Proficient in web technologies including JavaScript, HTML, CSS, React, AngularJS
Strong background in developing marketing and ecommerce websites to complex enterprise applications.
Dedicated to creating functional and aesthetically pleasing digital solutions.
Dedicated to creating functional and aesthetically pleasing digital solutions.
@@ -1,8 +1,8 @@
---
company: "CareWorks Tech"
role: "ServiceNow Developer"
dateStart: "06/01/2016"
dateEnd: "09/01/2017"
dateStart: 2016-06-01
dateEnd: 2017-09-01
---
Experienced ServiceNow developer with expertise in IT Service Management platforms.
@@ -11,4 +11,4 @@ Skilled in implementing and customizing ServiceNow solutions for enterprise clie
Knowledge of ITSM frameworks including INC, PRG, CHG, ESC to support business operations.
Proficient in configuring and maintaining ServiceNow applications to meet client requirements.
Proficient in configuring and maintaining ServiceNow applications to meet client requirements.
@@ -0,0 +1,20 @@
---
company: "zulily"
role: "Technical Change Manager"
dateStart: 2014-10-01
dateEnd: 2016-06-01
---
Designed and maintained internal tools for Fulfillment Center (FC) Operations, including:
- Weekly performance monitoring systems with actionable feedback for employee development and recognition.
- Employee recognition program to incentivize performance.
- Supplies inventory management system (e.g., Corrugated Boxes, Tape, Bubble Wrap) for tracking usage and movement.
- Employee kiosks for Overtime sign-ups, Voluntary-Time-Off, Department Transfers, and peer recognition.
- Dock Management System to streamline trailer tracking for transportation vendors.
Tested and approved deployments of Fulfillment Center Systems (FCS) tools for fulfillment tasks (e.g., Receive, Stow, Pick, Pack).
Documented and prioritized feature requests, improvements, and bug fixes from FC Operations, managing Agile sprints with weekly and biweekly check-ins to ensure project alignment.
Led operational process improvements to enhance efficiency, scalability, and overall FC operations performance.
@@ -1,8 +1,8 @@
---
company: "Amazon"
role: "Area Manager"
dateStart: "03/01/2010"
dateEnd: "10/01/2014"
dateStart: 2010-03-01
dateEnd: 2014-10-01
---
Monitored associate productivity metrics and resolved performance barriers.
@@ -13,4 +13,4 @@ Empowered direct reports to enforce safety, quality, and productivity standards.
Recruited top talent for individual contributors to boost team success.
Led cross-functional teams to implement processes improving operational efficiency in North America.
Led cross-functional teams to implement processes improving operational efficiency in North America.
@@ -1,8 +1,8 @@
---
company: "National Guard Bureau"
role: "Chaplain Assistant"
dateStart: "12/01/2007"
dateEnd: "12/01/2012"
dateStart: 2007-12-01
dateEnd: 2012-12-01
---
Support role within the National Guard Bureau focused on chaplain services and community outreach.
Support role within the National Guard Bureau focused on chaplain services and community outreach.
-20
View File
@@ -1,20 +0,0 @@
---
company: "zulily"
role: "Technical Change Manager"
dateStart: "10/01/2014"
dateEnd: "06/01/2016"
---
Designed and maintained internal tools for Fulfillment Center (FC) Operations, including:
Weekly performance monitoring systems with actionable feedback for employee development and recognition.
Employee recognition program to incentivize performance.
Supplies inventory management system (e.g., Corrugated Boxes, Tape, Bubble Wrap) for tracking usage and movement.
Employee kiosks for Overtime sign-ups, Voluntary-Time-Off, Department Transfers, and peer recognition.
Dock Management System to streamline trailer tracking for transportation vendors.
Tested and approved deployments of Fulfillment Center Systems (FCS) tools for fulfillment tasks (e.g., Receive, Stow, Pick, Pack).
Documented and prioritized feature requests, improvements, and bug fixes from FC Operations, managing Agile sprints with weekly and biweekly check-ins to ensure project alignment.
Led operational process improvements to enhance efficiency, scalability, and overall FC operations performance.
+55 -42
View File
@@ -1,58 +1,71 @@
---
import { type CollectionEntry, getCollection } from "astro:content"
import type { BlogPost, Project } from "@lib/types"
type Props = {
entry: CollectionEntry<"blog"> | CollectionEntry<"projects">
entry: BlogPost | Project | any
collection?: string
allEntries?: any[]
}
// Get the requested entry
const { entry } = Astro.props
const { collection } = entry
const { Content } = await entry.render()
const { entry, collection = "blog", allEntries = [] } = Astro.props
const content = entry?.content || ""
// Get the next and prev entries (modulo to wrap index)
const items = (await getCollection(collection))
.filter(post => !post.data.draft)
.sort((a, b) => b.data.date.getTime() - a.data.date.getTime())
const index = items.findIndex(x => x.slug === entry.slug)
const prev = items[(index - 1 + items.length) % items.length]
const next = items[(index + 1) % items.length]
// Find prev/next entries
let prevEntry: any = null
let nextEntry: any = null
if (allEntries.length > 0) {
const currentIndex = allEntries.findIndex((e: any) => e.id === entry.id)
if (currentIndex > 0) {
prevEntry = allEntries[currentIndex - 1]
}
if (currentIndex < allEntries.length - 1) {
nextEntry = allEntries[currentIndex + 1]
}
}
---
<div>
<article>
<Content/>
</article>
<article class="text-ink" set:html={content} />
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<a href={`/${prev.collection}/${prev.slug}`} class="group p-4 gap-3 flex items-center border rounded-lg hover:bg-black/5 hover:dark:bg-white/10 border-black/15 dark:border-white/20 blend">
<div class="order-2 w-full h-full group-hover:text-black group-hover:dark:text-white blend">
<div class="flex flex-wrap gap-2">
<div class="text-sm uppercase">
Prev
{prevEntry && (
<a href={`/${collection}/${prevEntry.id}`} class="group p-4 gap-3 flex items-center border rounded-lg bg-surface border-edge hover:bg-wash blend">
<div class="order-2 w-full h-full group-hover:text-link blend">
<div class="flex flex-wrap gap-2">
<div class="text-sm uppercase">
Prev
</div>
</div>
<div class="font-semibold mt-3 text-ink">
{prevEntry.title}
</div>
</div>
<div class="font-semibold mt-3 text-black dark:text-white">
{prev.data.title}
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="order-1 stroke-current rotate-180">
<line x1="5" y1="12" x2="19" y2="12" class="scale-x-0 group-hover:scale-x-100 translate-x-4 group-hover:translate-x-1 transition-all duration-300 ease-in-out" />
<polyline points="12 5 19 12 12 19" class="translate-x-0 group-hover:translate-x-1 transition-all duration-300 ease-in-out" />
</svg>
</a>
)}
{nextEntry && (
<a href={`/${collection}/${nextEntry.id}`} class="group p-4 gap-3 flex items-center border rounded-lg bg-surface border-edge hover:bg-wash transition-colors duration-300 ease-in-out blend">
<div class="w-full h-full text-right group-hover:text-link blend">
<div class="text-sm uppercase">
Next
</div>
<div class="font-semibold mt-3 text-ink">
{nextEntry.title}
</div>
</div>
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="stroke-current blend">
<line x1="5" y1="12" x2="19" y2="12" class="scale-x-0 group-hover:scale-x-100 translate-x-4 group-hover:translate-x-1 transition-all duration-300 ease-in-out" />
<polyline points="12 5 19 12 12 19" class="translate-x-0 group-hover:translate-x-1 transition-all duration-300 ease-in-out" />
</svg>
</a>
)}
{!prevEntry && !nextEntry && (
<div class="col-span-2 text-center py-8 text-ink-muted blend">
No adjacent articles available
</div>
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="order-1 stroke-current group-hover:stroke-black group-hover:dark:stroke-white rotate-180">
<line x1="5" y1="12" x2="19" y2="12" class="scale-x-0 group-hover:scale-x-100 translate-x-4 group-hover:translate-x-1 transition-all duration-300 ease-in-out" />
<polyline points="12 5 19 12 12 19" class="translate-x-0 group-hover:translate-x-1 transition-all duration-300 ease-in-out" />
</svg>
</a>
<a href={`/${next.collection}/${next.slug}`} class="group p-4 gap-3 flex items-center border rounded-lg hover:bg-black/5 hover:dark:bg-white/10 border-black/15 dark:border-white/20 transition-colors duration-300 ease-in-out">
<div class="w-full h-full text-right group-hover:text-black group-hover:dark:text-white blend">
<div class="text-sm uppercase">
Next
</div>
<div class="font-semibold mt-3 text-black dark:text-white">
{next.data.title}
</div>
</div>
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="stroke-current group-hover:stroke-black group-hover:dark:stroke-white">
<line x1="5" y1="12" x2="19" y2="12" class="scale-x-0 group-hover:scale-x-100 translate-x-4 group-hover:translate-x-1 transition-all duration-300 ease-in-out" />
<polyline points="12 5 19 12 12 19" class="translate-x-0 group-hover:translate-x-1 transition-all duration-300 ease-in-out" />
</svg>
</a>
)}
</div>
</div>
+23 -20
View File
@@ -1,27 +1,30 @@
---
import type { CollectionEntry } from "astro:content"
import type { BlogPost, Project } from "@lib/types"
import { formatDate, readingTime } from "@lib/utils"
type Props = {
entry: CollectionEntry<"projects"> | CollectionEntry<"blog">
entry: BlogPost | Project | any
collection?: string
}
const { entry } = Astro.props
const { collection, data, body } = entry
const { title, summary, date } = data
const demoUrl = collection === "projects" ? data.demoUrl : null
const repoUrl = collection === "projects" ? data.repoUrl : null
const { entry, collection = "blog" } = Astro.props
if (!entry) {
return null
}
const { title, summary, date } = entry
const demoUrl = "demoUrl" in entry ? entry.demoUrl : null
const repoUrl = "repoUrl" in entry ? entry.repoUrl : null
const body = entry.content || ""
---
<div>
<a href={`/${collection}`} class="group w-fit p-1.5 gap-1.5 text-sm flex items-center border rounded hover:bg-black/5 hover:dark:bg-white/10 border-black/15 dark:border-white/20 transition-colors duration-300 ease-in-out">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="stroke-current group-hover:stroke-black group-hover:dark:stroke-white">
<a href={`/${collection}`} class="group w-fit p-1.5 gap-1.5 text-sm flex items-center border text-ink rounded border-edge hover:bg-chip hover:text-chip-ink transition-colors duration-300 ease-in-out">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="stroke-current">
<line x1="19" y1="12" x2="5" y2="12" class="scale-x-0 group-hover:scale-x-100 translate-x-3 group-hover:translate-x-0 transition-all duration-300 ease-in-out" />
<polyline points="12 19 5 12 12 5" class="translate-x-1 group-hover:translate-x-0 transition-all duration-300 ease-in-out" />
</svg>
<div class="w-full group-hover:text-black group-hover:dark:text-white transition-colors duration-300 ease-in-out">
Back to {collection}
<div class="w-full transition-colors duration-300 ease-in-out">
Back to {`${collection.charAt(0).toUpperCase()}${collection.slice(1)}`}
</div>
</a>
<div class="flex flex-wrap text-sm uppercase mt-12 gap-3 opacity-75">
@@ -38,30 +41,30 @@ const repoUrl = collection === "projects" ? data.repoUrl : null
{readingTime(body)}
</div>
</div>
<h1 class="text-3xl font-semibold text-spaghetti-brown dark:text-spaghetti-brown mt-2">
<h1 class="text-3xl font-semibold text-ink mt-2">
{title}
</h1>
<div class="mt-1 text-spaghetti-brown dark:text-spaghetti-brown">
<div class="mt-1 text-ink-muted">
{summary}
</div>
{(demoUrl || repoUrl) &&
<div class="mt-4 flex flex-wrap gap-2">
{demoUrl &&
<a href={demoUrl} target="_blank" class="group flex gap-2 items-center px-3 py-1.5 truncate rounded text-xs md:text-sm lg:text-base border border-spaghetti-yellow/50 dark:border-spaghetti-yellow/50 hover:bg-spaghetti-yellow/20 hover:dark:bg-spaghetti-yellow/20 blend text-spaghetti-brown dark:text-spaghetti-brown">
<a href={demoUrl} target="_blank" class="group flex gap-2 items-center px-3 py-1.5 truncate rounded text-xs md:text-sm lg:text-base border border-edge hover:bg-chip blend text-ink group-hover:text-chip-ink">
<svg class="size-4">
<use href="/ui.svg#globe" class="fill-current group-hover:fill-black group-hover:dark:fill-white blend"/>
<use href="/ui.svg#globe" class="fill-current blend"/>
</svg>
<span class="text-current group-hover:text-black group-hover:dark:text-white blend">
<span class="text-current blend">
See Demo
</span>
</a>
}
{repoUrl &&
<a href={repoUrl} target="_blank" class="group flex gap-2 items-center px-3 py-1.5 truncate rounded text-xs md:text-sm lg:text-base border border-spaghetti-yellow/50 dark:border-spaghetti-yellow/50 hover:bg-spaghetti-yellow/20 hover:dark:bg-spaghetti-yellow/20 blend text-spaghetti-brown dark:text-spaghetti-brown">
<a href={repoUrl} target="_blank" class="group flex gap-2 items-center px-3 py-1.5 truncate rounded text-xs md:text-sm lg:text-base border border-edge hover:bg-chip blend text-ink group-hover:text-chip-ink">
<svg class="size-4">
<use href="/ui.svg#link" class="fill-current group-hover:fill-black group-hover:dark:fill-white blend"/>
<use href="/ui.svg#link" class="fill-current blend"/>
</svg>
<span class="text-current group-hover:text-black group-hover:dark:text-white blend">
<span class="text-current blend">
See Repository
</span>
</a>
+67
View File
@@ -0,0 +1,67 @@
// src/lib/__tests__/content.test.ts
import { describe, it, expect } from "vitest"
import { byDateDesc } from "../content"
/**
* Fixture factory rather than inline literals in every test: mirrors the shape
* of an Astro content entry (id + data.date) without pulling in astro:content.
*/
function dated(id: string, date: string) {
return { id, data: { date: new Date(date) } }
}
describe("byDateDesc", () => {
it("should order entries newest first when dates differ", () => {
// Arrange: loader order (by id) is oldest -> newest.
const entries = [
dated("01-building-my-personal-website", "2025-08-12"),
dated("03-spaghet-io-website-improvements", "2025-08-13"),
dated("04-marvinblade-and-spaghetai", "2026-11-03"),
]
// Act
const sorted = [...entries].sort(byDateDesc)
// Assert
expect(sorted.map((entry) => entry.id)).toEqual([
"04-marvinblade-and-spaghetai",
"03-spaghet-io-website-improvements",
"01-building-my-personal-website",
])
})
it("should reverse entries that the loader already sorted oldest first by filename", () => {
const entries = [
dated("astro-profile", "2025-08-01"),
dated("home-system", "2026-11-03"),
]
expect([...entries].sort(byDateDesc).map((entry) => entry.id)).toEqual([
"home-system",
"astro-profile",
])
})
it("should break ties on id when two entries share the same date", () => {
// Arrange: identical dates make the date comparison return 0.
const entries = [
dated("gitea", "2025-08-01"),
dated("astro-profile", "2025-08-01"),
]
// Act: sort twice to prove the result is stable, not build-order dependent.
const first = [...entries].sort(byDateDesc).map((entry) => entry.id)
const second = [...entries.reverse()].sort(byDateDesc).map((entry) => entry.id)
// Assert
expect(first).toEqual(["astro-profile", "gitea"])
expect(second).toEqual(first)
})
it("should leave single-entry and empty collections untouched without throwing", () => {
expect([...[dated("only", "2026-11-03")]].sort(byDateDesc).map((e) => e.id)).toEqual([
"only",
])
expect(([] as ReturnType<typeof dated>[]).sort(byDateDesc)).toEqual([])
})
})
+257
View File
@@ -0,0 +1,257 @@
// src/lib/__tests__/filters.test.ts
import { describe, it, expect } from "vitest"
import {
collectTags,
filterEntries,
hasActiveFilters,
matchesQuery,
normalizeTag,
parseFilterParams,
sortEntries,
tagCounts,
writeFilterParams,
DEFAULT_SORT,
type FilterState,
type ListEntry,
} from "../filters"
/** Mirrors the fields the listing island receives, without Astro's virtual module. */
function entry(
id: string,
tags: string[],
overrides: Partial<ListEntry> = {}
): ListEntry {
return {
id,
title: `Entry ${id}`,
summary: `Summary ${id}`,
date: "2026-01-01T00:00:00.000Z",
tags,
...overrides,
}
}
function state(overrides: Partial<FilterState> = {}): FilterState {
return { tags: [], query: "", sort: DEFAULT_SORT, ...overrides }
}
describe("normalizeTag", () => {
it("should case-fold and trim", () => {
expect(normalizeTag(" Tailwind CSS ")).toBe("tailwind css")
})
})
describe("collectTags", () => {
it("should collapse tags that differ only by case into one option", () => {
// The real bug: /projects carries both `Astro` and `astro` in frontmatter,
// so the sidebar rendered two checkboxes that did the same thing.
const tags = collectTags([
entry("a", ["Astro", "React"]),
entry("b", ["astro", "Tailwind CSS"]),
])
expect(tags.map((tag) => tag.key)).toEqual(["astro", "react", "tailwind css"])
})
it("should pick the most frequent spelling as the label", () => {
const tags = collectTags([
entry("a", ["astro"]),
entry("b", ["Astro"]),
entry("c", ["Astro"]),
])
expect(tags).toEqual([{ key: "astro", label: "Astro" }])
})
it("should keep the first-seen spelling when the counts tie", () => {
const first = collectTags([entry("a", ["Docker"]), entry("b", ["docker"])])
const second = collectTags([entry("a", ["docker"]), entry("b", ["Docker"])])
expect(first).toEqual([{ key: "docker", label: "Docker" }])
expect(second).toEqual([{ key: "docker", label: "docker" }])
})
it("should sort options alphabetically and drop blanks", () => {
const tags = collectTags([entry("a", ["zeta", "", " ", "alpha"])])
expect(tags.map((tag) => tag.label)).toEqual(["alpha", "zeta"])
})
it("should return nothing for an empty collection", () => {
expect(collectTags([])).toEqual([])
})
})
describe("matchesQuery", () => {
const post = entry("k", ["Docker"], {
title: "Home Server",
summary: "Unraid and backups",
})
it("should match everything on an empty or whitespace query", () => {
expect(matchesQuery(post, "")).toBe(true)
expect(matchesQuery(post, " ")).toBe(true)
})
it("should match title, summary and tags case-insensitively", () => {
expect(matchesQuery(post, "SERVER")).toBe(true)
expect(matchesQuery(post, "backups")).toBe(true)
expect(matchesQuery(post, "docKer")).toBe(true)
})
it("should not match the body, which is not part of the shape", () => {
expect(matchesQuery(post, "nope")).toBe(false)
})
})
describe("filterEntries", () => {
const entries = [
entry("css-html", ["CSS", "html"]),
entry("css-only", ["css"]),
entry("html-only", ["Html"]),
entry("rust-only", ["rust"]),
]
it("should return everything when nothing is selected", () => {
expect(filterEntries(entries, state()).map((e) => e.id)).toEqual([
"css-html",
"css-only",
"html-only",
"rust-only",
])
})
it("should OR selected tags, broadening rather than narrowing", () => {
// Deliberate change from the old AND behavior: clicking a second tag adds
// results, which is what a checkbox list looks like it does.
expect(filterEntries(entries, state({ tags: ["css", "html"] })).map((e) => e.id)).toEqual([
"css-html",
"css-only",
"html-only",
])
})
it("should match selected tags case-insensitively on both sides", () => {
expect(filterEntries(entries, state({ tags: ["CsS"] })).map((e) => e.id)).toEqual([
"css-html",
"css-only",
])
})
it("should intersect the keyword filter with the tag filter", () => {
const result = filterEntries(entries, state({ tags: ["css", "rust"], query: "html" }))
expect(result.map((e) => e.id)).toEqual(["css-html"])
})
it("should return nothing for a tag nobody carries", () => {
expect(filterEntries(entries, state({ tags: ["go"] }))).toEqual([])
})
it("should not throw when an entry is missing tags", () => {
const loose = [{ ...entry("a", []), tags: undefined }] as unknown as ListEntry[]
expect(() => filterEntries(loose, state({ tags: ["css"] }))).not.toThrow()
expect(collectTags(loose)).toEqual([])
})
})
describe("sortEntries", () => {
const entries = [
entry("old", [], { date: "2025-01-01T00:00:00.000Z", title: "Bravo" }),
entry("new", [], { date: "2026-01-01T00:00:00.000Z", title: "alpha" }),
entry("mid", [], { date: "2025-06-01T00:00:00.000Z", title: "Charlie" }),
]
it("should sort newest first by default", () => {
expect(sortEntries(entries, "newest").map((e) => e.id)).toEqual(["new", "mid", "old"])
})
it("should sort oldest first", () => {
expect(sortEntries(entries, "oldest").map((e) => e.id)).toEqual(["old", "mid", "new"])
})
it("should sort by title case-insensitively", () => {
expect(sortEntries(entries, "az").map((e) => e.title)).toEqual(["alpha", "Bravo", "Charlie"])
})
it("should not mutate the caller's array", () => {
const original = entries.map((e) => e.id)
sortEntries(entries, "oldest")
expect(entries.map((e) => e.id)).toEqual(original)
})
it("should tolerate an unparseable date without throwing", () => {
const broken = [entry("a", [], { date: "not-a-date" }), entry("b", [], { date: "2026-01-01T00:00:00.000Z" })]
expect(() => sortEntries(broken, "newest")).not.toThrow()
expect(sortEntries(broken, "newest").map((e) => e.id)).toEqual(["b", "a"])
})
})
describe("tagCounts", () => {
const entries = [
entry("a", ["Docker", "Astro"]),
entry("b", ["docker"]),
entry("c", ["Rust"]),
]
it("should count each tag once per entry", () => {
expect(tagCounts(entries, state()).get("docker")).toBe(2)
expect(tagCounts(entries, state()).get("astro")).toBe(1)
})
it("should count within the keyword filter", () => {
const counts = tagCounts(entries, state({ query: "Entry c" }))
expect(counts.get("rust")).toBe(1)
expect(counts.get("docker")).toBeUndefined()
})
it("should not count a tag twice when an entry spells it two ways", () => {
const counts = tagCounts([entry("a", ["Astro", "astro"])], state())
expect(counts.get("astro")).toBe(1)
})
})
describe("hasActiveFilters", () => {
it("should be false for the default state", () => {
expect(hasActiveFilters(state())).toBe(false)
})
it("should be true for tags, a keyword, or a non-default sort", () => {
expect(hasActiveFilters(state({ tags: ["css"] }))).toBe(true)
expect(hasActiveFilters(state({ query: " hi " }))).toBe(true)
expect(hasActiveFilters(state({ sort: "az" }))).toBe(true)
expect(hasActiveFilters(state({ query: " " }))).toBe(false)
})
})
describe("URL params", () => {
it("should round-trip tags, keyword and sort", () => {
const params = new URLSearchParams()
writeFilterParams(params, state({ tags: ["docker", "astro"], query: "home lab", sort: "oldest" }))
expect(parseFilterParams(params)).toEqual({
tags: ["docker", "astro"],
query: "home lab",
sort: "oldest",
})
})
it("should omit defaults so /blog stays clean", () => {
const params = new URLSearchParams()
writeFilterParams(params, state())
expect(params.toString()).toBe("")
})
it("should case-fold and dedupe tags when parsing", () => {
const parsed = parseFilterParams(new URLSearchParams("tags=Docker,docker,,astro"))
expect(parsed.tags).toEqual(["docker", "astro"])
})
it("should fall back to defaults for junk values", () => {
const parsed = parseFilterParams(new URLSearchParams("sort=random&tags=%20%20"))
expect(parsed.sort).toBe(DEFAULT_SORT)
expect(parsed.tags).toEqual([])
})
it("should ignore a missing sort entirely", () => {
expect(parseFilterParams(new URLSearchParams("q=x")).query).toBe("x")
})
})
+101
View File
@@ -0,0 +1,101 @@
// src/lib/__tests__/search.test.ts
import { describe, it, expect } from "vitest"
import {
createSearcher,
partitionByCollection,
runSearch,
MIN_QUERY_LENGTH,
} from "../search"
import type { SearchEntry } from "@lib/types"
const ENTRIES: SearchEntry[] = [
{
id: "01-building-my-personal-website",
slug: "01-building-my-personal-website",
collection: "blog",
title: "Building My Personal Website: From Idea to Deployment",
summary: "A journey through creating my personal portfolio site.",
tags: ["Tutorial", "Astro", "Portfolio", "Docker"],
date: "2025-08-12T00:00:00.000Z",
},
{
id: "astro-profile",
slug: "astro-profile",
collection: "projects",
title: "Astro Profile",
summary: "An Astro-based profile template with built in markdown support.",
tags: ["portfolio", "personal", "astro"],
date: "2025-08-08T00:00:00.000Z",
},
]
describe("createSearcher / runSearch", () => {
const searcher = createSearcher(ENTRIES)
it("should return no results when the query is shorter than MIN_QUERY_LENGTH", () => {
expect(runSearch(searcher, "")).toEqual([])
expect(runSearch(searcher, "a")).toEqual([])
// Whitespace-only input is treated as empty.
expect(runSearch(searcher, " ")).toEqual([])
})
it("should match on title", () => {
const results = runSearch(searcher, "website")
expect(results.map((entry) => entry.slug)).toContain(
"01-building-my-personal-website"
)
})
it("should match tags case-insensitively", () => {
const results = runSearch(searcher, "ASTRO")
expect(results.length).toBeGreaterThan(0)
expect(results.map((entry) => entry.slug)).toContain("astro-profile")
})
it("should tolerate a mistyped query (fuzzy match)", () => {
const results = runSearch(searcher, "websit")
expect(results.map((entry) => entry.slug)).toContain(
"01-building-my-personal-website"
)
})
it("should return no results when nothing matches", () => {
expect(runSearch(searcher, "zzzq")).toEqual([])
})
it("should never return fewer results than an exact substring match would", () => {
const query = "deployment"
const contains = ENTRIES.filter((entry) => entry.title.includes(query))
expect(runSearch(searcher, query).length).toBeGreaterThanOrEqual(
contains.length
)
})
it("should handle an empty dataset without throwing", () => {
const empty = createSearcher([])
expect(runSearch(empty, "astro")).toEqual([])
})
it("should not require MIN_QUERY_LENGTH to change the contract", () => {
expect(MIN_QUERY_LENGTH).toBeGreaterThan(1)
})
})
describe("partitionByCollection", () => {
it("should split results into posts and projects by collection", () => {
const { posts, projects } = partitionByCollection(ENTRIES)
expect(posts.map((entry) => entry.slug)).toEqual([
"01-building-my-personal-website",
])
expect(projects.map((entry) => entry.slug)).toEqual(["astro-profile"])
})
it("should return empty buckets for an empty result set", () => {
expect(partitionByCollection([])).toEqual({ posts: [], projects: [] })
})
it("should preserve every entry exactly once across both buckets", () => {
const { posts, projects } = partitionByCollection(ENTRIES)
expect(posts.length + projects.length).toBe(ENTRIES.length)
})
})
+160
View File
@@ -0,0 +1,160 @@
// src/lib/__tests__/status.test.ts
import { describe, it, expect } from "vitest"
import { parseBeatTime, summarize, monitorsInGroups, BEAT, type KumaHeartbeat } from "@lib/status"
const NOW = Date.parse("2026-11-05T21:00:00.000Z")
function beat(status: number, minutesAgo = 0): KumaHeartbeat {
const time = new Date(NOW - minutesAgo * 60_000)
const pad = (n: number, width = 2) => String(n).padStart(width, "0")
// Kuma emits naive UTC strings with millisecond precision.
const stamp =
`${time.getUTCFullYear()}-${pad(time.getUTCMonth() + 1)}-${pad(time.getUTCDate())} ` +
`${pad(time.getUTCHours())}:${pad(time.getUTCMinutes())}:${pad(time.getUTCSeconds())}` +
`.${pad(time.getUTCMilliseconds(), 3)}`
return { status, time: stamp, ping: 12 }
}
function list(...beats: KumaHeartbeat[]) {
return beats
}
describe("parseBeatTime", () => {
it("should read Kuma's naive timestamp as UTC, not local time", () => {
expect(parseBeatTime("2026-11-05 21:00:00.000")).toBe(NOW)
})
it("should accept an already-offset timestamp without double-applying UTC", () => {
expect(parseBeatTime("2026-11-05T21:00:00.000Z")).toBe(NOW)
})
it("should return null for a malformed timestamp", () => {
expect(parseBeatTime("not a time")).toBeNull()
expect(parseBeatTime("")).toBeNull()
})
})
describe("monitorsInGroups", () => {
const groups = [
{ name: "Critical Services", monitorList: [{ id: 75 }, { id: 36 }] },
{ name: "Game Servers", monitorList: [{ id: 89 }] },
]
it("should return null when no narrowing is configured", () => {
expect(monitorsInGroups(groups, [])).toBeNull()
})
it("should collect the monitor ids of the named groups, case-insensitively", () => {
const ids = monitorsInGroups(groups, ["critical services"])
expect(ids).not.toBeNull()
expect([...ids!].sort()).toEqual(["36", "75"])
})
it("should return an empty set when no group matches, so the caller reports unknown", () => {
expect(monitorsInGroups(groups, ["Nonexistent"])).toEqual(new Set<string>())
})
it("should tolerate a missing group list", () => {
expect(monitorsInGroups(null, ["Critical Services"])).toEqual(new Set<string>())
})
})
describe("summarize", () => {
it("should report all systems normal when every monitor's last beat is up", () => {
const snapshot = summarize({
now: NOW,
heartbeatList: {
"1": list(beat(BEAT.UP, 3), beat(BEAT.UP, 2), beat(BEAT.UP, 1)),
"2": list(beat(BEAT.UP, 1)),
},
})
expect(snapshot.state).toBe("up")
expect(snapshot.label).toBe("All systems normal")
expect(snapshot.summary).toEqual({ total: 2, up: 2, down: 0, pending: 0, maintenance: 0 })
})
it("should judge only the newest beat of each monitor", () => {
const snapshot = summarize({
now: NOW,
heartbeatList: {
// Recovered: an older down must not keep the footer red.
"1": list(beat(BEAT.DOWN, 9), beat(BEAT.UP, 1)),
// Regressed: an older up must not keep the footer green.
"2": list(beat(BEAT.UP, 9), beat(BEAT.DOWN, 1)),
},
})
expect(snapshot.state).toBe("degraded")
expect(snapshot.label).toBe("Partial outage")
expect(snapshot.summary).toEqual({ total: 2, up: 1, down: 1, pending: 0, maintenance: 0 })
})
it("should report a major outage when no monitor is up", () => {
const snapshot = summarize({
now: NOW,
heartbeatList: { "1": list(beat(BEAT.DOWN, 1)), "2": list(beat(BEAT.DOWN, 1)) },
})
expect(snapshot.state).toBe("down")
expect(snapshot.label).toBe("Major outage")
})
it("should treat a pending monitor as degraded rather than normal", () => {
const snapshot = summarize({
now: NOW,
heartbeatList: { "1": list(beat(BEAT.UP, 1)), "2": list(beat(BEAT.PENDING, 1)) },
})
expect(snapshot.state).toBe("degraded")
})
it("should surface maintenance ahead of outages, matching Uptime Kuma", () => {
const snapshot = summarize({
now: NOW,
heartbeatList: { "1": list(beat(BEAT.DOWN, 1)), "2": list(beat(BEAT.MAINTENANCE, 1)) },
})
expect(snapshot.state).toBe("maintenance")
expect(snapshot.label).toBe("Under maintenance")
})
it("should degrade the label when an incident is open even if every beat is up", () => {
const snapshot = summarize({
now: NOW,
incidents: [{ id: 1, name: "Plex down", is_public: true }],
heartbeatList: { "1": list(beat(BEAT.UP, 1)) },
})
expect(snapshot.state).toBe("degraded")
expect(snapshot.incidents).toBe(1)
})
it("should report unknown when the status page exposes no monitors", () => {
const snapshot = summarize({ now: NOW, heartbeatList: {} })
expect(snapshot.state).toBe("unknown")
expect(snapshot.reason).toBe("no-monitors")
expect(snapshot.label).toBe("Status unavailable")
})
it("should report unknown when the newest beat is older than the stale window", () => {
const snapshot = summarize({
now: NOW,
staleAfterMs: 900_000,
heartbeatList: { "1": list(beat(BEAT.UP, 20)) },
})
expect(snapshot.state).toBe("unknown")
expect(snapshot.reason).toBe("stale")
})
it("should tolerate a missing heartbeatList without throwing", () => {
const snapshot = summarize({ now: NOW, heartbeatList: null })
expect(snapshot.state).toBe("unknown")
expect(snapshot.summary.total).toBe(0)
})
it("should expose the newest beat time and the status page link for the footer", () => {
const snapshot = summarize({
now: NOW,
statusPageUrl: "https://uptime.spaghet.io/status/public",
heartbeatList: { "1": list(beat(BEAT.UP, 5)), "2": list(beat(BEAT.UP, 1)) },
})
expect(snapshot.lastBeatAt).toBe(new Date(NOW - 60_000).toISOString())
expect(snapshot.checkedAt).toBe(new Date(NOW).toISOString())
expect(snapshot.statusPageUrl).toBe("https://uptime.spaghet.io/status/public")
})
})
+51
View File
@@ -0,0 +1,51 @@
// src/lib/__tests__/utils.test.ts
import { describe, it, expect } from "vitest"
import { formatDate, readingTime, isNavActive } from "@lib/utils"
describe("formatDate", () => {
it("should render a frontmatter date exactly as authored when it is midnight UTC", () => {
expect(formatDate(new Date("2025-08-12T00:00:00.000Z"))).toBe("Aug 12, 2025")
})
it("should not shift the day when given an ISO string instead of a Date", () => {
expect(formatDate("2026-11-03T00:00:00.000Z")).toBe("Nov 03, 2026")
})
it("should stay stable for a date near the end of a month across timezones", () => {
expect(formatDate(new Date("2026-11-30T00:00:00.000Z"))).toBe("Nov 30, 2026")
})
})
describe("readingTime", () => {
it("should return a whole-number minute estimate for html content", () => {
expect(readingTime("<p>one two three</p>")).toBe("1 min read")
})
})
describe("isNavActive", () => {
it("should match an exact pathname", () => {
expect(isNavActive("/blog", "/blog")).toBe(true)
expect(isNavActive("/", "/")).toBe(true)
})
it("should match a nested route by its first path section", () => {
expect(isNavActive("/blog/some-post", "/blog")).toBe(true)
expect(isNavActive("/projects/tool", "/projects")).toBe(true)
})
it("should not match a different section", () => {
expect(isNavActive("/blog/some-post", "/projects")).toBe(false)
expect(isNavActive("/work", "/blog")).toBe(false)
})
it("should activate the search link on /search and its subpaths", () => {
// Regression: the drawer compared "/" + subpath[0] against the bare string
// "search", which could never be true, so the search pill never activated.
expect(isNavActive("/search", "/search")).toBe(true)
expect(isNavActive("/search/anything", "/search")).toBe(true)
})
it("should not treat the root path as a prefix for every link", () => {
expect(isNavActive("/blog", "/")).toBe(false)
})
})
-9
View File
@@ -1,9 +0,0 @@
import { Client, Storage } from "appwrite";
const client = new Client();
client
.setEndpoint(import.meta.env.APPWRITE_ENDPOINT) // Your Appwrite endpoint
.setProject(import.meta.env.APPWRITE_PROJECT_ID); // Your Project ID
export const storage = new Storage(client);
+43
View File
@@ -0,0 +1,43 @@
// src/lib/content.ts
import type { CollectionEntry } from "astro:content"
import type { SearchEntry } from "@lib/types"
/**
* Structural shape of anything the glob loader hands back for a dated
* collection. Deliberately narrower than CollectionEntry<"blog"> so the
* comparator can be unit tested without Astro's virtual module.
*/
interface DatedEntry {
id: string
data: { date: Date }
}
/**
* The glob loader returns entries in filename order, never by frontmatter
* date, so every listing page must opt into date ordering explicitly.
* Equal dates fall back to id to keep the order deterministic across builds
* (two projects share 2025-08-01).
*/
export function byDateDesc(a: DatedEntry, b: DatedEntry): number {
const diff = b.data.date.getTime() - a.data.date.getTime()
return diff !== 0 ? diff : a.id.localeCompare(b.id)
}
/**
* Map a blog or project content entry down to the slim, serializable shape
* used by ArrowCard and the search index. Centralising this keeps every page
* (home, blog, projects, search) emitting identical card props.
*/
export function toSearchEntry(
entry: CollectionEntry<"blog"> | CollectionEntry<"projects">
): SearchEntry {
return {
id: entry.id,
slug: entry.id,
collection: entry.collection as "blog" | "projects",
title: entry.data.title,
summary: entry.data.summary,
tags: entry.data.tags,
date: entry.data.date.toISOString(),
}
}
+184
View File
@@ -0,0 +1,184 @@
// src/lib/filters.ts
import type { ListEntry } from "@lib/types"
export type { ListEntry }
export type SortKey = "newest" | "oldest" | "az"
export const DEFAULT_SORT: SortKey = "newest"
export const SORT_KEYS: SortKey[] = ["newest", "oldest", "az"]
export const SORT_LABELS: Record<SortKey, string> = {
newest: "Newest first",
oldest: "Oldest first",
az: "Title A–Z",
}
export interface TagOption {
/** Case-folded identity, what gets stored in state and in the URL. */
key: string
/** The spelling shown to humans. */
label: string
}
export interface FilterState {
tags: string[]
query: string
sort: SortKey
}
export const TAGS_PARAM = "tags"
export const QUERY_PARAM = "q"
export const SORT_PARAM = "sort"
export function normalizeTag(tag: string): string {
return tag.trim().toLowerCase()
}
/**
* Dedupe tags case-insensitively and pick one canonical spelling per tag.
*
* Frontmatter is hand-written, so the same tag appears as both `Astro` and
* `astro` across the projects collection. Matching has always been
* case-insensitive, which meant the filter sidebar rendered two visually
* different checkboxes that did exactly the same thing. The label with the
* most occurrences wins; ties fall back to first-seen order, so the result is
* stable across builds.
*/
export function collectTags(entries: ListEntry[]): TagOption[] {
const spellings = new Map<string, Map<string, number>>()
for (const entry of entries) {
for (const raw of entry.tags ?? []) {
const label = raw.trim()
if (!label) continue
const key = normalizeTag(label)
const counts = spellings.get(key) ?? new Map<string, number>()
counts.set(label, (counts.get(label) ?? 0) + 1)
spellings.set(key, counts)
}
}
return Array.from(spellings, ([key, counts]) => ({
key,
label: mostFrequent(counts),
})).sort((a, b) => a.label.localeCompare(b.label))
}
/** Highest count wins; `Map` iteration order breaks ties by first insertion. */
function mostFrequent(counts: Map<string, number>): string {
let best = ""
let bestCount = -1
for (const [label, count] of counts) {
if (count > bestCount) {
best = label
bestCount = count
}
}
return best
}
/**
* Keyword match over the fields the card shows: title, summary and tags. Body
* text is intentionally out of scope — full-text search lives on /search.
*/
export function matchesQuery(entry: ListEntry, query: string): boolean {
const needle = query.trim().toLowerCase()
if (!needle) return true
return (
entry.title.toLowerCase().includes(needle) ||
entry.summary.toLowerCase().includes(needle) ||
(entry.tags ?? []).some((tag) => tag.toLowerCase().includes(needle))
)
}
/**
* OR semantics: an entry is kept when it carries *any* selected tag.
*
* The old filter AND-ed the selection, so picking a second tag almost always
* emptied the list with no explanation. Broadening on click is what the
* checkboxes look like they do.
*/
export function filterEntries<T extends ListEntry>(
entries: T[],
state: FilterState
): T[] {
const selected = state.tags.map(normalizeTag).filter(Boolean)
const matched = entries.filter(
(entry) =>
matchesQuery(entry, state.query) &&
(selected.length === 0 ||
(entry.tags ?? []).some((tag) => selected.includes(normalizeTag(tag))))
)
return sortEntries(matched, state.sort)
}
function timestamp(entry: ListEntry): number {
const ms = new Date(entry.date).getTime()
// A malformed frontmatter date must not sort the whole list to NaN.
return Number.isFinite(ms) ? ms : 0
}
export function sortEntries<T extends ListEntry>(entries: T[], sort: SortKey): T[] {
const copy = [...entries]
if (sort === "az") return copy.sort((a, b) => a.title.localeCompare(b.title))
if (sort === "oldest") return copy.sort((a, b) => timestamp(a) - timestamp(b))
return copy.sort((a, b) => timestamp(b) - timestamp(a))
}
/**
* How many entries each tag would contribute *within the current keyword
* filter*, keyed by tag. Tags are not counted against each other: under OR
* semantics every selected tag is contributing, and a count that collapsed as
* soon as you clicked something would read like the filter was broken.
*/
export function tagCounts(entries: ListEntry[], state: FilterState): Map<string, number> {
const counts = new Map<string, number>()
for (const entry of entries) {
if (!matchesQuery(entry, state.query)) continue
for (const key of new Set((entry.tags ?? []).map(normalizeTag))) {
if (!key) continue
counts.set(key, (counts.get(key) ?? 0) + 1)
}
}
return counts
}
export function hasActiveFilters(state: FilterState): boolean {
return state.tags.length > 0 || state.query.trim().length > 0 || state.sort !== DEFAULT_SORT
}
/**
* Read filter state out of a URL query string. Anything unparseable falls back
* to the default rather than throwing: these values come from a hand-edited
* address bar and have no contract to honour.
*/
export function parseFilterParams(params: URLSearchParams): FilterState {
const rawSort = params.get(SORT_PARAM)
return {
tags: Array.from(
new Set(
(params.get(TAGS_PARAM) ?? "")
.split(",")
.map(normalizeTag)
.filter(Boolean)
)
),
query: params.get(QUERY_PARAM) ?? "",
sort: SORT_KEYS.includes(rawSort as SortKey) ? (rawSort as SortKey) : DEFAULT_SORT,
}
}
/**
* Write filter state back into a URLSearchParams, omitting defaults so a plain
* /blog stays a clean, shareable /blog.
*/
export function writeFilterParams(params: URLSearchParams, state: FilterState): void {
if (state.tags.length > 0) params.set(TAGS_PARAM, state.tags.join(","))
else params.delete(TAGS_PARAM)
if (state.query.trim().length > 0) params.set(QUERY_PARAM, state.query.trim())
else params.delete(QUERY_PARAM)
if (state.sort !== DEFAULT_SORT) params.set(SORT_PARAM, state.sort)
else params.delete(SORT_PARAM)
}
+55
View File
@@ -0,0 +1,55 @@
// src/lib/search.ts
import Fuse, { type IFuseOptions } from "fuse.js"
import type { SearchEntry } from "@lib/types"
export type { SearchEntry }
/** Minimum characters before we bother running a query. */
export const MIN_QUERY_LENGTH = 2
const FUSE_OPTIONS: IFuseOptions<SearchEntry> = {
keys: [
{ name: "title", weight: 0.4 },
{ name: "tags", weight: 0.35 },
{ name: "summary", weight: 0.25 },
],
threshold: 0.4,
ignoreLocation: true,
minMatchCharLength: MIN_QUERY_LENGTH,
}
/**
* Build a reusable fuzzy searcher over a set of entries.
*
* The index is created once per island hydration, so typing does not rebuild
* it on every keystroke.
*/
export function createSearcher(entries: SearchEntry[]): Fuse<SearchEntry> {
return new Fuse(entries, FUSE_OPTIONS)
}
/**
* Run a fuzzy query. Queries shorter than `MIN_QUERY_LENGTH` yield no results,
* which lets the UI distinguish "not searched yet" from "searched, found none".
*/
export function runSearch(
searcher: Fuse<SearchEntry>,
rawQuery: string
): SearchEntry[] {
const query = rawQuery.trim()
if (query.length < MIN_QUERY_LENGTH) return []
return searcher.search(query).map((result) => result.item)
}
/**
* Partition a flat result set back into per-collection buckets for rendering.
*/
export function partitionByCollection(results: SearchEntry[]): {
posts: SearchEntry[]
projects: SearchEntry[]
} {
return {
posts: results.filter((entry) => entry.collection === "blog"),
projects: results.filter((entry) => entry.collection === "projects"),
}
}
+295
View File
@@ -0,0 +1,295 @@
/**
* Reads the public Uptime Kuma status page (https://uptime.spaghet.io/status/public)
* and reduces it to the single "is everything fine?" signal the footer shows.
*
* Two endpoints matter:
* GET /api/status-page/:slug -> config, incidents, monitor groups (~5 KB)
* GET /api/status-page/heartbeat/:slug -> last 100 beats per monitor (~200 KB)
*
* The heartbeat payload is far too heavy to hand to the browser, and Uptime Kuma
* only sends CORS headers in dev mode, so everything here runs server-side and the
* browser talks to our own /api/status route instead. Results are cached in-process
* (Uptime Kuma caches the heartbeat route for 1 minute anyway) and concurrent
* requests share one in-flight fetch so a busy page never stampedes the Kuma box.
*/
/** Beat statuses as defined by Uptime Kuma's `src/util.ts`. */
export const BEAT = {
DOWN: 0,
UP: 1,
PENDING: 2,
MAINTENANCE: 3,
} as const
export type SystemState = "up" | "degraded" | "down" | "maintenance" | "unknown"
export type UnknownReason = "no-monitors" | "stale" | "http-error" | "fetch-failed"
export interface KumaHeartbeat {
status: number
/** Naive server timestamp, e.g. "2026-11-05 21:05:09.655" (UTC). */
time: string
ping?: number | null
msg?: string
}
export interface StatusSnapshot {
state: SystemState
/** Footer copy, e.g. "All systems normal". */
label: string
summary: {
total: number
up: number
down: number
pending: number
maintenance: number
}
incidents: number
/** ISO timestamp of when the upstream data was read. */
checkedAt: string
/** Newest beat timestamp seen, ISO. Useful for spotting a paused Kuma. */
lastBeatAt: string | null
reason?: UnknownReason
statusPageUrl: string
}
const LABELS: Record<SystemState, string> = {
up: "All systems normal",
degraded: "Partial outage",
down: "Major outage",
maintenance: "Under maintenance",
unknown: "Status unavailable",
}
interface StatusConfig {
base: string
slug: string
pageUrl: string
apiUrl: string
heartbeatUrl: string
cacheTtlMs: number
timeoutMs: number
staleAfterMs: number
/** Group names that count toward the footer light. Empty = every group. */
watchGroups: string[]
}
function envInt(name: string, fallback: number): number {
const raw = process.env[name]
if (raw === undefined || raw === "") return fallback
const parsed = Number.parseInt(raw, 10)
return Number.isFinite(parsed) && parsed > 0 ? parsed : fallback
}
export function statusConfig(): StatusConfig {
const base = (process.env.STATUS_PAGE_URL ?? "https://uptime.spaghet.io").replace(/\/+$/, "")
const slug = process.env.STATUS_PAGE_SLUG ?? "public"
return {
base,
slug,
pageUrl: `${base}/status/${slug}`,
apiUrl: `${base}/api/status-page/${slug}`,
heartbeatUrl: `${base}/api/status-page/heartbeat/${slug}`,
cacheTtlMs: envInt("STATUS_CACHE_TTL_SECONDS", 60) * 1000,
timeoutMs: envInt("STATUS_TIMEOUT_SECONDS", 4) * 1000,
// A monitor that has not reported in this long means Kuma itself is idle or
// the beat loop died, so the last known "up" can no longer be trusted.
staleAfterMs: envInt("STATUS_STALE_AFTER_SECONDS", 900) * 1000,
// Opt-in narrowing, e.g. STATUS_WATCH_GROUPS="Critical Services,Database Services"
// so a hobby game server cannot turn the footer red.
watchGroups: (process.env.STATUS_WATCH_GROUPS ?? "")
.split(",")
.map((name) => name.trim())
.filter(Boolean),
}
}
/**
* Kuma stores beat times as naive UTC strings. `new Date("...")` would parse them
* in the runtime's local zone, so pin the offset explicitly.
*/
export function parseBeatTime(time: string): number | null {
if (!time) return null
const normalized = /(?:Z|[+-]\d{2}:?\d{2})$/.test(time)
? time
: `${time.replace(" ", "T")}Z`
const ms = Date.parse(normalized)
return Number.isNaN(ms) ? null : ms
}
/**
* Pure reduction of the upstream payloads into one state. Mirrors Uptime Kuma's
* own `overallStatus()` computed property: maintenance wins immediately, any
* non-up beat degrades the page, and zero up beats means a total outage.
*/
export function summarize(input: {
incidents?: unknown[] | null
heartbeatList?: Record<string, KumaHeartbeat[]> | null
now?: number
staleAfterMs?: number
statusPageUrl?: string
}): StatusSnapshot {
const now = input.now ?? Date.now()
const staleAfterMs = input.staleAfterMs ?? 900_000
const heartbeatList = input.heartbeatList ?? {}
const incidents = Array.isArray(input.incidents) ? input.incidents : []
const summary = { total: 0, up: 0, down: 0, pending: 0, maintenance: 0 }
let newestBeatMs: number | null = null
for (const beats of Object.values(heartbeatList)) {
const last = beats?.[beats.length - 1]
if (!last) continue
summary.total += 1
if (last.status === BEAT.UP) summary.up += 1
else if (last.status === BEAT.DOWN) summary.down += 1
else if (last.status === BEAT.PENDING) summary.pending += 1
else if (last.status === BEAT.MAINTENANCE) summary.maintenance += 1
const beatMs = parseBeatTime(last.time)
if (beatMs !== null && (newestBeatMs === null || beatMs > newestBeatMs)) newestBeatMs = beatMs
}
let state: SystemState
let reason: UnknownReason | undefined
if (summary.total === 0) {
state = "unknown"
reason = "no-monitors"
} else if (newestBeatMs !== null && now - newestBeatMs > staleAfterMs) {
state = "unknown"
reason = "stale"
} else if (summary.maintenance > 0) {
state = "maintenance"
} else if (summary.up === 0) {
state = "down"
} else if (summary.down > 0 || summary.pending > 0 || incidents.length > 0) {
state = "degraded"
} else {
state = "up"
}
return {
state,
label: LABELS[state],
summary,
incidents: incidents.length,
checkedAt: new Date(now).toISOString(),
lastBeatAt: newestBeatMs === null ? null : new Date(newestBeatMs).toISOString(),
...(reason ? { reason } : {}),
statusPageUrl: input.statusPageUrl ?? "https://uptime.spaghet.io/status/public",
}
}
function snapshotForError(statusPageUrl: string, reason: UnknownReason): StatusSnapshot {
const empty = summarize({ heartbeatList: {}, statusPageUrl })
return { ...empty, state: "unknown", label: LABELS.unknown, reason }
}
async function fetchJson(url: string, timeoutMs: number): Promise<unknown> {
const response = await fetch(url, {
signal: AbortSignal.timeout(timeoutMs),
headers: { accept: "application/json", "user-agent": "spaghet.io-status/1.0" },
})
if (!response.ok) throw new Error(`Uptime Kuma returned ${response.status} for ${url}`)
return response.json()
}
/**
* Monitor ids belonging to the named groups (case-insensitive). Used when
* STATUS_WATCH_GROUPS narrows the footer light to a subset of the status page.
* Returns null when no narrowing is configured, so callers can skip filtering.
*/
export function monitorsInGroups(
publicGroupList: Array<{ name?: string; monitorList?: Array<{ id: number | string }> }> | null | undefined,
watchGroups: string[]
): Set<string> | null {
if (watchGroups.length === 0) return null
const wanted = new Set(watchGroups.map((name) => name.toLowerCase()))
const ids = new Set<string>()
for (const group of publicGroupList ?? []) {
if (!wanted.has(String(group?.name ?? "").toLowerCase())) continue
for (const monitor of group.monitorList ?? []) ids.add(String(monitor.id))
}
return ids
}
async function readUpstream(config: StatusConfig): Promise<StatusSnapshot> {
// The heartbeat route carries no incident info, and the page route carries no
// beats, so both are needed. They are independent, so fetch them together.
const [page, heartbeat] = await Promise.all([
fetchJson(config.apiUrl, config.timeoutMs) as Promise<{
incidents?: unknown[]
publicGroupList?: Array<{ name?: string; monitorList?: Array<{ id: number }> }>
}>,
fetchJson(config.heartbeatUrl, config.timeoutMs) as Promise<{
heartbeatList?: Record<string, KumaHeartbeat[]>
}>,
])
const heartbeatList = heartbeat?.heartbeatList ?? {}
const allowed = monitorsInGroups(page?.publicGroupList, config.watchGroups)
const scoped = allowed
? Object.fromEntries(Object.entries(heartbeatList).filter(([id]) => allowed.has(id)))
: heartbeatList
return summarize({
incidents: page?.incidents,
heartbeatList: scoped,
staleAfterMs: config.staleAfterMs,
statusPageUrl: config.pageUrl,
})
}
let cached: { snapshot: StatusSnapshot; expiresAt: number } | null = null
let inFlight: Promise<StatusSnapshot> | null = null
async function load(config: StatusConfig): Promise<StatusSnapshot> {
try {
const snapshot = await readUpstream(config)
cached = { snapshot, expiresAt: Date.now() + config.cacheTtlMs }
return snapshot
} catch (error: unknown) {
const reason: UnknownReason =
error instanceof Error && /returned \d{3}/.test(error.message) ? "http-error" : "fetch-failed"
if (process.env.NODE_ENV !== "test") {
console.error("[status] Uptime Kuma unreachable:", error instanceof Error ? error.message : error)
}
// Never throw at a caller: an unreachable Kuma becomes an honest "unknown"
// so the footer degrades instead of 500ing every page render.
const fallback = snapshotForError(config.pageUrl, reason)
cached = { snapshot: fallback, expiresAt: Date.now() + config.cacheTtlMs }
return fallback
} finally {
inFlight = null
}
}
/**
* Cached, single-flight view of the status page.
*
* A page render never waits on Uptime Kuma twice: the first request fetches, and
* while that is in flight everyone else joins it. Once a snapshot exists, an
* expired cache serves the previous value immediately and refreshes in the
* background (stale-while-revalidate), which keeps TTFB flat even if Kuma is slow.
*/
export async function getSystemStatus(opts: { force?: boolean } = {}): Promise<StatusSnapshot> {
const config = statusConfig()
if (inFlight) return inFlight
if (cached) {
const fresh = cached.expiresAt > Date.now()
if (!opts.force) {
if (fresh) return cached.snapshot
// Expired: serve the previous value and revalidate behind it.
inFlight = load(config)
void inFlight
return cached.snapshot
}
}
inFlight = load(config)
return inFlight
}
+80
View File
@@ -0,0 +1,80 @@
export interface BlogPost {
id: string;
title: string;
summary: string;
date: string;
tags: string[];
draft: boolean;
content: string;
template: string;
featured: boolean;
}
export interface Project {
id: string;
title: string;
summary: string;
date: string;
tags: string[];
draft: boolean;
content: string;
/** Optional in the content schema (`z.string().optional()`), so optional here too. */
demoUrl?: string;
repoUrl?: string;
}
/**
* The slim, client-serializable shape of a searchable document.
*
* Markdown `body` is deliberately excluded: serializing every post's full
* content into the island's `props` measured 21,873 chars (43.5 KB page) and
* was never matched against, so it was pure payload tax.
*/
export interface SearchEntry {
id: string;
slug: string;
collection: "blog" | "projects";
title: string;
summary: string;
tags: string[];
date: string;
}
/**
* The fields a listing card and its filters actually read.
*
* Deliberately excludes the markdown `content`: the /blog and /projects islands
* serialized every entry's full body into the island's props on each request and
* never matched against it. `BlogPost`, `Project` and `SearchEntry` all satisfy
* this shape structurally, so cards and filters accept any of them.
*/
export interface ListEntry {
id: string;
title: string;
summary: string;
date: string;
tags: string[];
}
/**
* Shape accepted by ArrowCard. A union so the cards on the blog/projects
* listing pages (flat ListEntry) and search results (SearchEntry, which
* carries `collection` + `slug`) both type-check.
*/
export type CardEntry = ListEntry | SearchEntry
export interface WorkExperience {
id: string;
company: string;
role: string;
dateStart: string;
dateEnd: string;
content: string;
}
export interface LegalDocument {
id: string;
title: string;
date: string;
content: string;
}
+31 -2
View File
@@ -5,11 +5,40 @@ export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
export function formatDate(date: Date) {
/**
* Colors for the active (current-page) nav pill, shared by Header.astro and
* Drawer.astro so the four copies cannot drift apart again.
*
* No `dark:` variants: `chip` / `chip-ink` are re-declared under `html.dark` in
* src/styles/global.css, so the same classes give brown-on-noodle in light mode
* and espresso-on-charred-yellow in dark mode.
*/
export const ACTIVE_NAV_COLORS = "bg-chip text-chip-ink"
/**
* Whether a nav link is the active one: exact match, or the first path section
* of the current URL (so /blog/some-post highlights the /blog link).
*
* Shared by Header.astro and Drawer.astro. Note the drawer previously compared
* `"/" + subpath?.[0]` against the bare string `"search"`, which can never be
* true; every caller now passes the same href it renders.
*/
export function isNavActive(pathname: string, href: string): boolean {
if (pathname === href) return true
const section = pathname.match(/[^/]+/g)?.[0]
return section !== undefined && `/${section}` === href
}
export function formatDate(date: Date | string) {
if (typeof date === "string") date = new Date(date)
return Intl.DateTimeFormat("en-US", {
month: "short",
day: "2-digit",
year: "numeric"
year: "numeric",
// Frontmatter dates such as `date: 2025-08-12` parse to midnight UTC. Without
// pinning the timezone, formatting in a negative-offset locale (EST) shifted
// every authored date one day earlier on screen.
timeZone: "UTC",
}).format(date)
}
+24
View File
@@ -0,0 +1,24 @@
import type { APIRoute } from "astro"
import { getSystemStatus } from "@lib/status"
export const prerender = false
/**
* Footer-safe view of the Uptime Kuma status page: one small JSON document,
* server-fetched and cached, so the browser never has to (and can't) reach the
* Kuma API directly — it sends no CORS headers outside dev.
*/
export const GET: APIRoute = async ({ url }) => {
const force = url.searchParams.get("refresh") === "1"
const snapshot = await getSystemStatus({ force })
return new Response(JSON.stringify(snapshot), {
status: 200,
headers: {
"content-type": "application/json; charset=utf-8",
// The server already caches upstream, so keep the browser cache short and
// let the footer's own timer drive refreshes.
"cache-control": "public, max-age=30, stale-while-revalidate=120",
},
})
}
+22 -14
View File
@@ -1,35 +1,43 @@
---
import { type CollectionEntry, getCollection } from "astro:content"
import { getCollection } from "astro:content"
import PageLayout from "@layouts/PageLayout.astro"
import TopLayout from "@layouts/TopLayout.astro"
import BottomLayout from "@layouts/BottomLayout.astro"
import ArticleTopLayout from "@layouts/ArticleTopLayout.astro"
import ArticleBottomLayout from "@layouts/ArticleBottomLayout.astro"
// Create the static blog pages
export const prerender = true
export async function getStaticPaths() {
const posts = await getCollection("blog")
return posts.map((post) => ({
params: { slug: post.slug },
props: post,
}))
const entries = await getCollection("blog", ({ data }) => !data.draft)
// The article layouts expect the flat BlogPost shape (title/summary/date at the
// top level). Astro's collection entries nest frontmatter under `data`, so
// spreading the entry alone left every article heading blank and made
// formatDate(undefined) fall back to today's date.
const flat = entries.map((entry) => ({
...entry,
...entry.data,
content: entry.rendered?.html ?? "",
}))
return entries.map((entry, i) => ({
params: { slug: entry.id },
props: { entry: flat[i], allEntries: flat },
}))
}
// Get the requested post
type Props = CollectionEntry<"blog">
const post = Astro.props
const { title, summary } = post.data
const { entry, allEntries } = Astro.props
const { title, summary } = entry.data
---
<PageLayout title={title} description={summary}>
<TopLayout>
<div class="animate">
<ArticleTopLayout entry={post}/>
<ArticleTopLayout entry={entry}/>
</div>
</TopLayout>
<BottomLayout>
<div class="animate">
<ArticleBottomLayout entry={post} />
<ArticleBottomLayout entry={entry} allEntries={allEntries} />
</div>
</BottomLayout>
</PageLayout>
</PageLayout>
+20 -9
View File
@@ -3,15 +3,28 @@ import { getCollection } from "astro:content"
import PageLayout from "@layouts/PageLayout.astro"
import TopLayout from "@layouts/TopLayout.astro"
import BottomLayout from "@layouts/BottomLayout.astro"
import Blog from "@components/Blog"
import FilteredList from "@components/FilteredList"
import { BLOG } from "@consts"
import { byDateDesc } from "@lib/content"
import { parseFilterParams } from "@lib/filters"
const posts = (await getCollection("blog"))
.filter(post => !post.data.draft)
.sort((a, b) => b.data.date.getTime() - a.data.date.getTime())
const entries = await getCollection("blog", ({ data }) => !data.draft)
// Only the fields the cards and the filters read. `content` was serialized into
// the island's props on every request and never matched against — the markdown
// body is the single largest thing on this page.
const posts = entries
.sort(byDateDesc)
.map((entry) => ({
id: entry.id,
title: entry.data.title,
summary: entry.data.summary,
date: entry.data.date.toISOString(),
tags: entry.data.tags,
}))
const tags = [...new Set(posts.flatMap(post => post.data.tags))]
.sort((a, b) => a.localeCompare(b))
// Frontmatter runs on the server, so the initial filter state has to come from
// the request URL rather than `window.location` (see src/pages/search/index.astro).
const initial = parseFilterParams(Astro.url.searchParams)
---
<PageLayout title={BLOG.TITLE} description={BLOG.DESCRIPTION}>
@@ -22,9 +35,7 @@ const tags = [...new Set(posts.flatMap(post => post.data.tags))]
</TopLayout>
<BottomLayout>
<div class="animate">
<Blog client:load tags={tags} data={posts} />
<FilteredList client:load collection="blog" entries={posts} initial={initial} />
</div>
</BottomLayout>
</PageLayout>
+56 -45
View File
@@ -4,18 +4,21 @@ import PageLayout from "@layouts/PageLayout.astro"
import ArrowCard from "@components/ArrowCard"
import StackCard from "@components/StackCard.astro"
import { SITE, SOCIALS } from "@consts"
import TwinklingStars from "@components/TwinklingStars.astro"
import MeteorShower from "@components/MeteorShower.astro"
import { byDateDesc, toSearchEntry } from "@lib/content"
import ParmesanFlecks from "@components/ParmesanFlecks.astro"
import MeatballShower from "@components/MeatballShower.astro"
const posts = (await getCollection("blog"))
.filter(post => !post.data.draft)
.sort((a, b) => b.data.date.getTime() - a.data.date.getTime())
.slice(0,3)
const allBlogEntries = await getCollection("blog", ({ data }) => !data.draft)
const posts = allBlogEntries
.sort(byDateDesc)
.slice(0, 3)
.map(toSearchEntry)
const projects = (await getCollection("projects"))
.filter(project => !project.data.draft)
.sort((a, b) => b.data.date.getTime() - a.data.date.getTime())
.slice(0,3)
const allProjectEntries = await getCollection("projects", ({ data }) => !data.draft)
const projects = allProjectEntries
.sort(byDateDesc)
.slice(0, 3)
.map(toSearchEntry)
const stack = [
{
@@ -37,7 +40,7 @@ const stack = [
text: "Tailwind",
icon: "tailwind",
href: "https://tailwindcss.com"
},
}
]
---
@@ -51,17 +54,17 @@ const stack = [
</div>
<!-- Dark Theme: Stars -->
<div class='absolute inset-0 bg-black hidden dark:block'>
<div class='absolute inset-0 bg-page hidden dark:block'>
<div id='stars1' class='fixed inset-0'></div>
<div id='stars2' class='fixed inset-0'></div>
<div id='stars3' class='fixed inset-0'></div>
</div>
<!-- Dark Theme: Twinkling Stars / Metors -->
<!-- Dark Theme: Parmesan Flecks / Meatball Shower -->
<div id="galaxy" class="fixed inset-0">
<div class="hidden dark:block">
<TwinklingStars/>
<MeteorShower/>
<ParmesanFlecks/>
<MeatballShower/>
</div>
</div>
@@ -70,17 +73,23 @@ const stack = [
<!-- HERO -->
<section class="relative h-screen w-full">
<div id="planetcont" class='animate absolute inset-0 top-1/4 overflow-hidden'>
<div id="crescent" class='absolute top-0 left-1/2 -translate-x-1/2 w-[250vw] min-h-[100vh] aspect-square rounded-full p-[1px] bg-gradient-to-b from-black/25 dark:from-white/75 from-0% to-transparent to-5%'>
<div id="planet" class='w-full h-full bg-white dark:bg-black rounded-full p-[1px] overflow-hidden flex justify-center'>
<div id="blur" class='w-full h-20 rounded-full bg-neutral-900/25 dark:bg-white/25 blur-3xl'/>
<div id="crescent" class='absolute top-0 left-1/2 -translate-x-1/2 w-[250vw] min-h-[100vh] aspect-square rounded-full p-[1px] bg-gradient-to-b from-ink/25 dark:from-ink/75 from-0% to-transparent to-5%'>
<div id="planet" class='w-full h-full bg-surface rounded-full p-[1px] overflow-hidden flex justify-center'>
<div id="blur" class='w-full h-20 rounded-full bg-ink/25 blur-3xl'/>
</div>
</div>
</div>
<!-- The planet's `surface` fill (white in light mode) reaches the bottom of the hero, so its
shared edge with the `page`-coloured About section below reads as a hard line at 100vh.
This fades the last of the hero into the page colour. Both ends are theme tokens, so it
follows the light/dark flip with no `dark:` variant. It comes after #planetcont so it
paints over it, and is click-through so the CTAs stay usable. -->
<div aria-hidden="true" class="pointer-events-none absolute inset-x-0 bottom-0 h-40 bg-gradient-to-b from-page/0 from-25% to-page"></div>
<div class="animate absolute h-full w-full flex items-center justify-center">
<div class='relative w-full h-full flex items-center justify-center text-spaghetti-brown/100 dark:text-spaghetti-crea'>
<div class='relative w-full h-full flex items-center justify-center text-ink'>
<div class='p-5 text-center'>
<img src="/images/profile.jpg" alt="Quinn Marvin" class="rounded-full w-32 h-32 mx-auto mb-4 border-4 border-spaghetti-brown dark:border-spaghetti-cream" />
<p class='animated text-lg md:text-xl lg:text-2xl font-semibold opacity-75 '>
<img src='/images/profile.jpg' alt="Quinn Marvin" class="rounded-full w-32 h-32 mx-auto mb-4 border-4 border-edge" />
<p class='animated text-lg md:text-xl lg:text-2xl font-semibold opacity-75'>
Hello, I am Quinn Marvin
</p>
<p class='animated text-2xl md:text-3xl lg:text-4xl font-bold uppercase'>
@@ -90,16 +99,16 @@ const stack = [
Passionate about spaghetti, noodles and all things tech.
</p>
<p class='animated text-sm md:text-base lg:text-lg opacity-75 mt-2'>
Running 2 Unraid servers with Docker container ecosystem
Two home servers: one stores everything, one does the thinking
</p>
<p class='animated text-sm md:text-base lg:text-lg opacity-75 mt-1'>
Supporting PostgreSQL, MariaDB, MySQL, MongoDB, Redis, and Minio
258 TB of storage, 81 services, and AI that runs in my own house
</p>
<div id="ctaButtons" class='animated flex flex-wrap gap-4 justify-center mt-5'>
<a href='/blog' class='py-2 px-4 rounded truncate text-xs md:text-sm lg:text-base bg-spaghetti-red dark:bg-spaghetti-red dark:text-spaghetti-brown hover:opacity-75 blend'>
<a href='/blog' class='py-2 px-4 rounded truncate text-xs md:text-sm lg:text-base bg-link text-page hover:bg-link-hover blend'>
Read my blog
</a>
<a href='/work' class='py-2 px-4 truncate rounded text-xs md:text-sm lg:text-base border border-spaghetti-yellow/50 dark:border-spaghetti-yellow/50 hover:bg-spaghetti-yellow/20 hover:dark:bg-spaghetti-yellow/20 blend dark:text-spaghetti-cream'>
<a href='/work' class='py-2 px-4 truncate rounded text-xs md:text-sm lg:text-base border border-edge text-ink hover:bg-chip hover:text-chip-ink blend'>
View my work
</a>
</div>
@@ -108,17 +117,18 @@ const stack = [
</div>
</section>
<div class="relative bg-white dark:bg-black dark:text-spaghetti-brown">
<div class="relative bg-page text-ink">
<div class="mx-auto max-w-screen-sm p-5 space-y-24 pb-16">
<!-- About Section -->
<section class="animate">
<article class="text-spaghetti-brown/100 dark:text-spaghetti-cream">
<article class="text-ink">
<p>Hello! I'm Quinn Marvin, a passionate CEO/Creator/Innovator with an unrelenting love for spaghetti, noodles, and all things tech.</p>
<p>With 10+ years of experience building high-performing engineering teams and driving innovation in dynamic environments, I combine deep technical expertise with exceptional emotional intelligence and a human-centered leadership approach.</p>
<p>I specialize in IT Service Management (ITSM), IT Operations Management (ITOM), and IT Asset Management (ITAM), positioning myself as a trusted advisor to enterprise clients.</p>
<p>My technical background includes extensive experience with Docker, Kubernetes, and cloud platforms to deliver scalable, secure, and compliant solutions for complex projects.</p>
<p>Currently running 2 Unraid servers with powerful hardware configurations (128GB RAM, 2 x E5 Xeon CPU, 200TB raw storage on NetApp arrays) and a comprehensive Docker container ecosystem supporting PostgreSQL, MariaDB, MySQL, MongoDB, Redis, and Minio.</p>
<p>Currently I run two home servers built for opposite jobs. <strong>MarvinBlade</strong> holds about 258 TB across thirty hard drives, with extra protection so the files survive drives failing. <strong>SpaghetAI</strong> has almost no storage at all but a great deal of memory and two graphics cards, so that AI tools can answer questions about my own documents without those documents leaving the house. Eighty-one programs run across the two, covering media, photos, files, finances, and automation, with one sign-in protecting the things that matter.</p>
<p>How and why, in plain language: <a href="/blog/04-marvinblade-and-spaghetai/">Running AI From My Own Computers</a>.</p>
<p>Just like the perfect bowl of spaghetti - structured, well-organized, and satisfying to use - I'm passionate about creating technology solutions that are both functional and elegant.</p>
</article>
</section>
@@ -127,11 +137,11 @@ const stack = [
<section class="animate">
<div class="space-y-4">
<div class="flex justify-between">
<p class="font-semibold text-spaghetti-brown dark:text-spaghetti-cream">
<p class="font-semibold text-ink">
Recent posts
</p>
<a href="/blog" class="w-fit col-span-3 group flex gap-1 items-center underline decoration-[.5px] decoration-black/25 dark:decoration-white/50 hover:decoration-black dark:hover:decoration-white text-black dark:text-white underline-offset-2 blend">
<span class="text-black/75 dark:text-white/75 group-hover:text-black group-hover:dark:text-white blend">
<a href="/blog" class="w-fit col-span-3 group flex gap-1 items-center underline decoration-[.5px] decoration-edge text-ink-muted underline-offset-2 hover:text-link hover:decoration-link blend">
<span class="group-hover:text-link blend">
All posts
</span>
</a>
@@ -139,7 +149,7 @@ const stack = [
<ul class="space-y-4">
{posts.map((post) => (
<li>
<ArrowCard entry={post} />
<ArrowCard entry={post} collection={'blog'} />
</li>
))}
</ul>
@@ -149,11 +159,11 @@ const stack = [
<!-- Tech Stack Section -->
<section class="animate">
<div class="space-y-4">
<p class="font-semibold text-spaghetti-brown dark:text-spaghetti-cream">
<p class="font-semibold text-ink">
Website build with
</p>
<div class="flex flex-wrap items-center gap-2 mt-5">
{stack.map(item => (
{stack.map((item) => (
<StackCard
text={item.text}
icon={item.icon}
@@ -161,10 +171,10 @@ const stack = [
/>
))}
</div>
<div class="dark:text-spaghetti-cream">
<div class="text-ink">
Performing reactivity and statefulness, special guest
<a href="https://www.solidjs.com/" target="_blank" class="w-fit group underline decoration-[.5px] decoration-black/25 dark:decoration-white/50 hover:decoration-black dark:hover:decoration-white text-black dark:text-white underline-offset-2 blend">
<span class="text-black/75 dark:text-white/75 group-hover:text-black group-hover:dark:text-white blend">
<a href="https://www.solidjs.com/" target="_blank" class="w-fit group underline decoration-[.5px] decoration-edge text-ink-muted underline-offset-2 hover:text-link hover:decoration-link blend">
<span class="group-hover:text-link blend">
SolidJS
</span>
</a>
@@ -176,11 +186,11 @@ const stack = [
<section class="animate">
<div class="space-y-4">
<div class="flex justify-between">
<p class="font-semibold text-spaghetti-brown dark:text-spaghetti-cream">
<p class="font-semibold text-ink">
Recent projects
</p>
<a href="/projects" class="w-fit col-span-3 group flex gap-1 items-center underline decoration-[.5px] decoration-black/25 dark:decoration-white/50 hover:decoration-black dark:hover:decoration-white text-black dark:text-white underline-offset-2 blend">
<span class="text-black/75 dark:text-white/75 group-hover:text-black group-hover:dark:text-white blend">
<a href="/projects" class="w-fit col-span-3 group flex gap-1 items-center underline decoration-[.5px] decoration-edge text-ink-muted underline-offset-2 hover:text-link hover:decoration-link blend">
<span class="group-hover:text-link blend">
All projects
</span>
</a>
@@ -188,7 +198,7 @@ const stack = [
<ul class="space-y-4">
{projects.map((project) => (
<li>
<ArrowCard entry={project} />
<ArrowCard entry={project} collection={'projects'} />
</li>
))}
</ul>
@@ -197,7 +207,7 @@ const stack = [
<!-- Contact Section -->
<section class="animate">
<div class=" text-spaghetti-brown dark:text-spaghetti-cream">
<div class=" text-ink">
<p class="font-semibold">
Let's Connect
</p>
@@ -205,20 +215,21 @@ const stack = [
Reach out to me via email or on social media.
</p>
<div class="grid grid-cols-4 gap-y-2 mt-4 auto-cols-min">
{SOCIALS.map(social => (
{SOCIALS.map((social) => (
<div class="col-span-1 flex items-center gap-1">
<span class="whitespace-nowrap truncate">
{social.NAME}
</span>
</div>
<div class="col-span-3 truncate">
<a href={social.HREF} target="_blank" class="w-fit col-span-3 group flex gap-1 items-center underline decoration-[.5px] decoration-black/25 dark:decoration-white/50 hover:decoration-black dark:hover:decoration-white text-black dark:text-white underline-offset-2 blend">
<span class="text-black/75 dark:text-white/75 group-hover:text-black group-hover:dark:text-white blend">
<a href={social.HREF} target="_blank" class="w-fit col-span-3 group flex gap-1 items-center underline decoration-[.5px] decoration-edge text-ink-muted underline-offset-2 hover:text-link hover:decoration-link blend">
<span class="group-hover:text-link blend">
{social.TEXT}
</span>
</a>
</div>
))}
</div>
</div>
</section>
</div>
+14 -20
View File
@@ -1,42 +1,36 @@
---
import { type CollectionEntry, getCollection } from "astro:content"
export const prerender = true;
import { getCollection } from "astro:content"
import PageLayout from "@layouts/PageLayout.astro"
import TopLayout from "@layouts/TopLayout.astro"
import BottomLayout from "@layouts/BottomLayout.astro"
import { formatDate } from "@lib/utils"
import { SITE } from "@consts"
// Create the static pages for legal docs
export async function getStaticPaths() {
const docs = await getCollection("legal")
return docs.map((doc) => ({
params: { slug: doc.slug },
props: doc,
}))
const entries = await getCollection("legal")
return entries.map((entry) => ({
params: { slug: entry.id },
props: { entry },
}))
}
// Get the requested legal doc
type Props = CollectionEntry<"legal">;
const doc = Astro.props
const { title, date } = doc.data
const { Content } = await doc.render();
const { entry } = Astro.props
const doc = entry
---
<PageLayout title={title} description={`${title} for ${SITE.TITLE}`}>
<PageLayout title={doc.data.title} description={`${doc.data.title} for ${SITE.TITLE}`}>
<TopLayout>
<div class="animate">
<div class="page-heading">
{title}
{doc.data.title}
</div>
<p class="font-normal opacity-75">
Last updated: {formatDate(date)}
Last updated: {formatDate(doc.data.date)}
</p>
</div>
</TopLayout>
<BottomLayout>
<article class="animate">
<Content/>
</article>
<article class="animate prose dark:prose-invert text-ink" set:html={doc.rendered?.html}></article>
</BottomLayout>
</PageLayout>
</PageLayout>
+20 -14
View File
@@ -1,35 +1,41 @@
---
import { type CollectionEntry, getCollection } from "astro:content"
import { getCollection } from "astro:content"
import PageLayout from "@layouts/PageLayout.astro"
import TopLayout from "@layouts/TopLayout.astro"
import BottomLayout from "@layouts/BottomLayout.astro"
import ArticleTopLayout from "@layouts/ArticleTopLayout.astro"
import ArticleBottomLayout from "@layouts/ArticleBottomLayout.astro"
// Create the static projects pages
export const prerender = true
export async function getStaticPaths() {
const projects = await getCollection("projects")
return projects.map((project) => ({
params: { slug: project.slug },
props: project,
}))
const entries = await getCollection("projects", ({ data }) => !data.draft)
// Flatten frontmatter to the shape ArticleTopLayout/ArticleBottomLayout expect;
// see the note in src/pages/blog/[...slug].astro.
const flat = entries.map((entry) => ({
...entry,
...entry.data,
content: entry.rendered?.html ?? "",
}))
return entries.map((entry, i) => ({
params: { slug: entry.id },
props: { entry: flat[i], allEntries: flat },
}))
}
// Get the requested project
type Props = CollectionEntry<"projects">
const project = Astro.props
const { title, summary } = project.data
const { entry, allEntries } = Astro.props
const { title, summary } = entry.data
---
<PageLayout title={title} description={summary}>
<TopLayout>
<div class="animate">
<ArticleTopLayout entry={project} />
<ArticleTopLayout entry={entry} collection="projects"/>
</div>
</TopLayout>
<BottomLayout>
<div class="animate">
<ArticleBottomLayout entry={project} />
<ArticleBottomLayout entry={entry} collection="projects" allEntries={allEntries} />
</div>
</BottomLayout>
</PageLayout>
</PageLayout>
+18 -7
View File
@@ -3,15 +3,26 @@ import { getCollection } from "astro:content"
import PageLayout from "@layouts/PageLayout.astro"
import TopLayout from "@layouts/TopLayout.astro"
import BottomLayout from "@layouts/BottomLayout.astro"
import Projects from "@components/Projects"
import FilteredList from "@components/FilteredList"
import { PROJECTS } from "@consts"
import { byDateDesc } from "@lib/content"
import { parseFilterParams } from "@lib/filters"
const projects = (await getCollection("projects"))
.filter(project => !project.data.draft)
.sort((a, b) => b.data.date.getTime() - a.data.date.getTime())
const entries = await getCollection("projects", ({ data }) => !data.draft)
// Only the fields the cards and the filters read; see src/pages/blog/index.astro.
const projects = entries
.sort(byDateDesc)
.map((entry) => ({
id: entry.id,
title: entry.data.title,
summary: entry.data.summary,
date: entry.data.date.toISOString(),
tags: entry.data.tags,
}))
const tags = [...new Set(projects.flatMap(project => project.data.tags))]
.sort((a, b) => a.localeCompare(b))
// Frontmatter runs on the server, so the initial filter state has to come from
// the request URL rather than `window.location` (see src/pages/search/index.astro).
const initial = parseFilterParams(Astro.url.searchParams)
---
<PageLayout title={PROJECTS.TITLE} description={PROJECTS.DESCRIPTION}>
@@ -22,7 +33,7 @@ const tags = [...new Set(projects.flatMap(project => project.data.tags))]
</TopLayout>
<BottomLayout>
<div class="animate">
<Projects client:load tags={tags} data={projects} />
<FilteredList client:load collection="projects" entries={projects} initial={initial} />
</div>
</BottomLayout>
</PageLayout>
+11 -14
View File
@@ -7,24 +7,21 @@ type Context = {
}
export async function GET(context: Context) {
const posts = await getCollection("blog")
const projects = await getCollection("projects")
const items = [...posts, ...projects]
items.sort((a, b) => new Date(b.data.date).getTime() - new Date(a.data.date).getTime())
const entries = await getCollection("blog", ({ data }) => !data.draft)
const items = entries
.sort((a, b) => b.data.date.getTime() - a.data.date.getTime())
.map((entry) => ({
title: entry.data.title,
description: entry.data.summary,
pubDate: entry.data.date,
link: `/blog/${entry.id}/`,
}))
return rss({
title: SITE.TITLE,
description: SITE.DESCRIPTION,
site: context.site,
items: items.map((item) => ({
title: item.data.title,
description: item.data.summary,
pubDate: item.data.date,
link: item.slug.startsWith("blog")
? `/blog/${item.slug}/`
: `/projects/${item.slug}/`,
})),
items: items,
})
}
+36 -9
View File
@@ -1,18 +1,45 @@
---
import { type CollectionEntry, getCollection } from "astro:content"
import { getCollection } from "astro:content"
import PageLayout from "@layouts/PageLayout.astro"
import TopLayout from "@layouts/TopLayout.astro"
import BottomLayout from "@layouts/BottomLayout.astro"
import Search from "@components/Search"
import { SEARCH } from "@consts"
import type { SearchEntry } from "@lib/search"
const posts = (await getCollection("blog"))
.filter(post => !post.data.draft)
// Blog posts -> slim searchable entries.
// `body` is intentionally NOT serialized to the client; see src/lib/search.ts.
const blogEntries = await getCollection("blog", ({ data }) => !data.draft)
const posts: SearchEntry[] = blogEntries.map((entry) => ({
id: entry.id,
slug: entry.id,
collection: "blog",
title: entry.data.title,
summary: entry.data.summary,
date: entry.data.date.toISOString(),
tags: entry.data.tags,
}))
const projects = (await getCollection("projects"))
.filter(post => !post.data.draft)
// Projects -> slim searchable entries.
const projectEntries = await getCollection("projects", ({ data }) => !data.draft)
const projects: SearchEntry[] = projectEntries.map((entry) => ({
id: entry.id,
slug: entry.id,
collection: "projects",
title: entry.data.title,
summary: entry.data.summary,
date: entry.data.date.toISOString(),
tags: entry.data.tags,
}))
const data = [...posts, ...projects] as CollectionEntry<"blog">[]
const entries: SearchEntry[] = [...posts, ...projects]
// Read the `?search=` param from the incoming SSR request.
// NOTE: this frontmatter runs on the server, so `window` is never available
// here. The previous `typeof window !== 'undefined' ? window.location.href : ...`
// guard always fell through to a query-less localhost URL, so deep links,
// refreshes and back/forward silently lost the user's query.
const initialQuery = Astro.url.searchParams.get("search") ?? ""
---
<PageLayout title={SEARCH.TITLE} description={SEARCH.DESCRIPTION}>
@@ -22,8 +49,8 @@ const data = [...posts, ...projects] as CollectionEntry<"blog">[]
</div>
</TopLayout>
<BottomLayout>
<div class="animate">
<Search client:load data={data}/>
<div class="animate" id="search-container">
<Search client:load query={initialQuery} entries={entries} />
</div>
</BottomLayout>
</PageLayout>
</PageLayout>
+9 -19
View File
@@ -5,19 +5,10 @@ import TopLayout from "@layouts/TopLayout.astro"
import BottomLayout from "@layouts/BottomLayout.astro"
import { WORK } from "@consts"
const collection = await getCollection("work")
collection.sort((a, b) => new Date(b.data.dateStart).getTime() - new Date(a.data.dateStart).getTime())
const work = await Promise.all(
collection.map(async (item) => {
const { Content } = await item.render()
return { ...item, Content }
})
)
const work = await getCollection("work")
function formatWorkDate(input: Date | string) {
if (typeof input === "string") return input
if (typeof input === "string") input = new Date(input)
const month = input.toLocaleDateString("en-US", {
month: "short",
@@ -37,23 +28,22 @@ function formatWorkDate(input: Date | string) {
<BottomLayout>
<ul>
{
work.map((entry) => (
<li class="animate border-b border-black/10 dark:border-white/25 mt-4 py-8 first-of-type:mt-0 first-of-type:pt-0 last-of-type:border-none">
<div class="text-sm uppercase mb-4">
work.sort((a, b) => a.data.dateEnd > b.data.dateEnd ? -1 : b.data.dateEnd > a.data.dateEnd ? 1 : 0).map((entry) => (
<li class="animate border-b border-line mt-4 py-8 first-of-type:mt-0 first-of-type:pt-0 last-of-type:border-none">
<div class="text-sm uppercase mb-4 text-accent">
{formatWorkDate(entry.data.dateStart)} - {formatWorkDate(entry.data.dateEnd)}
</div>
<div class="text-black dark:text-white font-semibold">
<div class="text-ink font-semibold">
{entry.data.company}
</div>
<div class="text-sm font-semibold">
<div class="text-sm font-semibold text-accent">
{entry.data.role}
</div>
<article class="prose dark:prose-invert">
<entry.Content />
</article>
<article class="prose dark:prose-invert text-ink" set:html={entry.rendered?.html}></article>
</li>
))
}
</ul>
</BottomLayout>
</PageLayout>
+455 -204
View File
@@ -1,14 +1,145 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@import "tailwindcss";
:root{
--copy-btn-margin:10px;
/* Pastel Palette Colors for Spaghetti Theme */
--spaghetti-yellow: #FDE68A;
--spaghetti-red: #FECACA;
--spaghetti-cream: #FEF3C7;
--spaghetti-brown: #78350F;
/* v4 replacement for v3's `darkMode: "class"`. Required so public/js/theme.js
toggling `.dark` on <html> actually drives the `dark:` utilities. */
@custom-variant dark (&:where(.dark, .dark *));
@plugin "@tailwindcss/typography";
/**
* THE ONE PALETTE.
*
* Everything visual hangs off semantic tokens below. Utilities are generated from
* `--color-*` in `@theme`, and Tailwind emits them as `var(--color-*)` references,
* so re-declaring the same names under `html.dark` (see just after this block)
* flips the whole site at runtime. That is why components no longer need `dark:`
* colour variants: `bg-surface` is cream-white in light mode and espresso in dark,
* from the same class.
*
* The pasta identity lives in the *values*, not the names: sauce-red links,
* noodle-yellow chips, meatball-brown ink, parmesan highlights, and a warm
* espresso plate for the night-sky mode. Ratios in the comments are measured
* against the surface they sit on (WCAG AA: 4.5:1 body text, 3:1 large text and
* interactive borders).
*/
@theme {
/* --- Surfaces ---------------------------------------------------------- */
--color-page: #FBF3E2; /* warm cream plate (light) / espresso (dark) */
--color-surface: #FFFFFF; /* raised card on the plate */
--color-wash: #F5EAD5; /* hover fill */
/* --- Ink --------------------------------------------------------------- */
--color-ink: #3E2113; /* 13.3:1 on page, 14.7:1 on surface */
--color-ink-muted: #6B4A32; /* 7.2:1 on page */
--color-accent: #7A4E0F; /* dates, eyebrows, labels — 6.5:1 on page */
/* --- Sauce ------------------------------------------------------------- */
--color-link: #B3261E; /* 5.9:1 on page */
--color-link-hover: #8C1B15; /* 8.3:1 on page */
/* --- Edges ------------------------------------------------------------- */
--color-edge: #9C8874; /* interactive borders — 3.07:1 on page (WCAG 1.4.11) */
--color-line: #E4D9C6; /* decorative hairlines and dividers */
/* --- Noodles / parmesan ------------------------------------------------ */
--color-chip: #FDE68A; /* tag + pill fill */
--color-chip-ink: #3E2113; /* 11.8:1 on chip */
/* Code blocks are a raised white card, not a tinted one. Measured: the
`light-plus` syntax tokens (worst case #e50000 property names) hold 4.85:1
on #FFFFFF but fall to 4.07:1 on the tinted #F5EAD5, so any cream wash
under code puts real code text below AA. */
--color-code-bg: #FFFFFF;
--color-focus: #B3261E; /* focus ring, 5.9:1 on page */
/* --- Status light (footer) --------------------------------------------- */
--color-status-ok: #15803D;
--color-status-ok-ping: #4ADE80;
--color-status-warn: #B45309;
--color-status-warn-ping: #FBBF24;
--color-status-down: #B3261E;
--color-status-down-ping: #F87171;
--color-status-maint: #3730A3;
--color-status-maint-ping: #A5B4FC;
--color-status-unknown: #6B7280;
/* --- Decorative source palette (hero sky, gradients, art) -------------- *
* Raw ingredient colours. Never used for text: the pastels are tuned for
* the dark sky and fall to 1.1-1.5:1 on the cream plate. */
--color-spaghetti-yellow: #FDE68A;
--color-spaghetti-red: #FECACA;
--color-spaghetti-cream: #FEF3C7;
--color-spaghetti-brown: #78350F;
--color-spaghetti-dark-cream: #F5E6D3;
--color-spaghetti-dark-red: #FCA5A5;
--color-spaghetti-dark-yellow: #FCD34D;
--color-marinara: #E23B2C;
--color-marinara-dark: #B3261E;
--color-meatball: #A05A2E;
--color-meatball-mid: #6B3418;
--color-meatball-dark: #34190C;
--color-parmesan: #FFF6E5;
/* --- Type -------------------------------------------------------------- */
--font-sans: "Atkinson", system-ui, sans-serif;
/* --- Motion ------------------------------------------------------------ */
--animate-twinkle: twinkle 2s ease-in-out forwards;
--animate-meatball: meatball 3s ease-in-out forwards;
--animate-tumble: meatball-tumble 1.4s linear infinite;
@keyframes twinkle {
0% { opacity: 0; transform: rotate(0deg); }
50% { opacity: 1; transform: rotate(180deg); }
100% { opacity: 0; transform: rotate(360deg); }
}
/* Streak travels up its own length (head of the meatball leads, sauce trails). */
@keyframes meatball {
0% { opacity: 0; transform: translateY(200%); }
50% { opacity: 1; }
100% { opacity: 0; transform: translateY(0); }
}
@keyframes meatball-tumble {
0% { transform: rotate(0deg); }
100% { transform: rotate(200deg); }
}
}
/**
* Dark mode: same names, cooked longer. Only the values change, so every
* `bg-page` / `text-ink` / `border-edge` class in the components follows.
*/
html.dark {
--color-page: #140C08;
--color-surface: #1E130D;
--color-wash: #241811;
--color-ink: #F5E6D3; /* 15.8:1 on page */
--color-ink-muted: #C9B49B; /* 9.7:1 on page */
--color-accent: #FCD34D; /* 13.4:1 on page */
--color-link: #FCA5A5; /* 10.2:1 on page */
--color-link-hover: #FFD1D1; /* 14.1:1 on page */
--color-edge: #6E6359; /* 3.31:1 on page, 3.11:1 on surface */
--color-line: #2E2620;
--color-chip: #3E3014;
--color-chip-ink: #F5E6D3; /* 10.5:1 on chip */
--color-code-bg: #1E130D;
--color-focus: #FCD34D;
--color-status-ok: #22C55E;
--color-status-ok-ping: #86EFAC;
--color-status-warn: #F59E0B;
--color-status-warn-ping: #FCD34D;
--color-status-down: #E23B2C;
--color-status-down-ping: #FCA5A5;
--color-status-maint: #818CF8;
--color-status-maint-ping: #A5B4FC;
--color-status-unknown: #9CA3AF;
}
@layer base {
@@ -19,7 +150,7 @@
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "Atkinson";
src: url("/fonts/atkinson-bold.woff") format("woff");
@@ -27,180 +158,209 @@
font-style: normal;
font-display: swap;
}
html {
overflow-y: scroll;
color-scheme: light;
background-color: var(--color-page);
font-family: var(--font-sans);
}
html.dark {
color-scheme: dark;
}
body {
@apply relative flex h-full w-full flex-col antialiased;
background-color: var(--color-page);
color: var(--color-ink);
}
main {
@apply flex flex-1 flex-col;
background-color: var(--color-page);
color: var(--color-ink);
}
header {
@apply border-b transition-all duration-300 ease-in-out;
}
header:not(.scrolled) {
@apply border-transparent bg-transparent;
}
header.scrolled {
/* Sits on the plate, so it has to be a translucent version of it. A fixed
white/75 over cream page read as 1.00:1 — an invisible bar over content. */
background-color: color-mix(in oklab, var(--color-page) 78%, transparent);
@apply border-line backdrop-blur-sm saturate-200;
}
.page-heading {
@apply font-semibold;
color: var(--color-ink);
}
::selection {
background-color: var(--color-chip);
color: var(--color-chip-ink);
}
:focus-visible {
outline: 2px solid var(--color-focus);
outline-offset: 2px;
}
}
html {
overflow-y: scroll;
color-scheme: light;
background-color: var(--spaghetti-cream);
font-family: "Atkinson", sans-serif;
/**
* PROSE.
*
* The typography plugin only exposes its colours through `--tw-prose-*`, so this
* is the single place article styling is set. Declared for `.prose` and
* `.prose-invert` together: the tokens already flip with `html.dark`, so the
* invert variant is now a no-op kept only so existing markup keeps working.
*
* The `html` prefix is load-bearing, not decoration. Tailwind emits the plugin's
* own `.prose { --tw-prose-*: oklch(…) }` defaults into the same `components`
* layer but *after* this block, so at equal specificity the plugin would win and
* articles would render slate instead of sauce. `html .prose` is (0,1,1) and
* outranks it.
*/
@layer components {
/* `article` is in the list because the base rule below applies the `prose`
utility with @apply, which inlines the plugin's oklch defaults onto the
element. Blog articles carry no `.prose` class of their own, so they need
these tokens directly or they render slate. */
html .prose,
html .prose-invert,
html article {
--tw-prose-body: var(--color-ink);
--tw-prose-headings: var(--color-ink);
--tw-prose-lead: var(--color-ink-muted);
--tw-prose-links: var(--color-link);
--tw-prose-bold: var(--color-ink);
--tw-prose-counters: var(--color-accent);
--tw-prose-bullets: var(--color-accent);
--tw-prose-hr: var(--color-line);
--tw-prose-quotes: var(--color-ink);
--tw-prose-quote-borders: var(--color-chip);
--tw-prose-captions: var(--color-ink-muted);
--tw-prose-code: var(--color-ink);
--tw-prose-pre-code: var(--color-ink);
--tw-prose-pre-bg: var(--color-code-bg);
--tw-prose-th-borders: var(--color-edge);
--tw-prose-td-borders: var(--color-line);
/* The plugin's invert set points at the same tokens; without this, markup
carrying `prose-invert` would fall back to the plugin's slate defaults. */
--tw-prose-invert-body: var(--color-ink);
--tw-prose-invert-headings: var(--color-ink);
--tw-prose-invert-lead: var(--color-ink-muted);
--tw-prose-invert-links: var(--color-link);
--tw-prose-invert-bold: var(--color-ink);
--tw-prose-invert-counters: var(--color-accent);
--tw-prose-invert-bullets: var(--color-accent);
--tw-prose-invert-hr: var(--color-line);
--tw-prose-invert-quotes: var(--color-ink);
--tw-prose-invert-quote-borders: var(--color-chip);
--tw-prose-invert-captions: var(--color-ink-muted);
--tw-prose-invert-code: var(--color-ink);
--tw-prose-invert-pre-code: var(--color-ink);
--tw-prose-invert-pre-bg: var(--color-code-bg);
--tw-prose-invert-th-borders: var(--color-edge);
--tw-prose-invert-td-borders: var(--color-line);
}
article {
@apply prose max-w-full pb-12;
}
article img {
@apply mx-auto block py-5;
}
/* Inline code needs a fill of its own; the plugin gives it none.
Two things are load-bearing here:
- `article` is in the selector list because article bodies are styled by the
base `article { @apply prose }` rule, not by a `.prose` class, so the
plugin inlines its defaults as `article :where(code) …`. A `.prose`-only
rule would never match a blog post.
- The `html` prefix wins the tie: the plugin's
`article :where(code):not(:where([class~=not-prose] *))::before { content: "`" }`
is (0,0,2) and emitted after a bare `:where` rule of equal weight, so
without it the literal backticks survive. */
html .prose :where(code):not(:where(pre code, [class~="not-prose"], [class~="not-prose"] *)),
html article :where(code):not(:where(pre code, [class~="not-prose"], [class~="not-prose"] *)) {
background-color: var(--color-code-bg);
border: 1px solid var(--color-line);
border-radius: 0.25rem;
padding: 0.1em 0.35em;
}
html .prose :where(code):not(:where(pre code, [class~="not-prose"], [class~="not-prose"] *))::before,
html .prose :where(code):not(:where(pre code, [class~="not-prose"], [class~="not-prose"] *))::after,
html article :where(code):not(:where(pre code, [class~="not-prose"], [class~="not-prose"] *))::before,
html article :where(code):not(:where(pre code, [class~="not-prose"], [class~="not-prose"] *))::after {
content: none;
}
/* With `defaultColor: false` Shiki no longer paints a background inline, so
the block is ours to colour. `article pre` is listed alongside `.prose pre`
for the same reason as the inline-code rule above: article bodies get prose
styling from `article { @apply prose }`, so a blog post's <pre> does not
match a `.prose` class selector and would otherwise lose its border. */
.prose pre,
html article pre {
background-color: var(--color-code-bg);
border: 1px solid var(--color-line);
border-radius: 0.5rem;
color: var(--color-ink);
}
/**
* Dual-theme Shiki swap.
*
* `themes: { light, dark }` + `defaultColor: false` puts each token's colour
* in `--shiki-light` / `--shiki-dark` custom properties rather than a hard
* `color:`, so nothing is painted until a rule like these chooses one per
* mode. No `!important` is needed — the inline styles carry only the custom
* properties, never a `color`.
*
* Only colour is swapped — this Shiki version emits no `--shiki-*-style`
* variables, so forcing font-style here would flatten italic tokens.
*/
.astro-code {
color: var(--shiki-light);
}
.astro-code span {
color: var(--shiki-light);
}
html.dark .astro-code,
html.dark .astro-code span {
color: var(--shiki-dark);
}
.prose blockquote {
border-left-color: var(--color-chip);
font-style: normal;
}
.prose a {
text-decoration-color: color-mix(in oklab, var(--color-link) 45%, transparent);
text-underline-offset: 3px;
transition: color 300ms ease-in-out, text-decoration-color 300ms ease-in-out;
}
.prose a:hover {
color: var(--color-link-hover);
text-decoration-color: currentColor;
}
}
html.dark {
color-scheme: dark;
background-color: #000000; /* Darker black for better contrast */
}
/* Apply pastel cream background to main content areas */
main {
@apply flex flex-col flex-1 bg-spaghetti-cream dark:bg-black;
}
html,
body {
@apply h-full w-full antialiased;
@apply text-black/75 dark:text-white/75;
}
/* Better dark mode text contrast */
.dark {
--tw-text-opacity: 1;
color: rgba(255, 255, 255, var(--tw-text-opacity));
}
/* Improved border visibility in dark mode */
.border-black\/15 {
border-color: rgba(255, 255, 255, 0.15) !important;
}
.border-white\/20 {
border-color: rgba(255, 255, 255, 0.2) !important;
}
/* Better contrast for links and important text */
.prose a {
color: var(--spaghetti-red) !important;
}
.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
color: #ffffff !important;
}
.prose code {
color: #ffffff !important;
}
.prose blockquote {
border-left-color: var(--spaghetti-yellow) !important;
}
.prose th,
.prose td {
color: #ffffff !important;
}
.page-heading {
@apply font-semibold text-black dark:text-white;
}
/* Better contrast for text elements */
.text-spaghetti-brown {
color: #f59e0b !important; /* Amber-400 for better visibility */
}
/* Better background for code blocks in dark mode */
.prose pre {
background-color: #1f2937 !important; /* gray-800 */
color: #f9fafb !important; /* gray-50 */
}
/* Improved dark mode for cards and buttons */
.group:hover .border-black\/15,
.group:hover .border-white\/20 {
border-color: rgba(255, 255, 255, 0.3) !important;
}
/* Pastel Theme Colors */
.text-spaghetti-yellow {
color: var(--spaghetti-yellow);
}
.text-spaghetti-red {
color: var(--spaghetti-red);
}
.text-spaghetti-brown {
color: var(--spaghetti-brown);
}
.bg-spaghetti-cream {
background-color: var(--spaghetti-cream);
}
body {
@apply relative flex flex-col;
@apply bg-white dark:bg-black;
}
main {
@apply flex flex-col flex-1 bg-white dark:bg-black;
}
header {
@apply border-b;
@apply transition-all duration-300 ease-in-out;
}
header:not(.scrolled) {
@apply bg-transparent border-transparent;
}
header.scrolled {
@apply bg-white/75 dark:bg-black/50;
@apply border-black/10 dark:border-white/25;
@apply backdrop-blur-sm saturate-200;
}
article {
@apply prose dark:prose-invert max-w-full pb-12;
/* Ensure our theme colors are applied properly in prose */
color: var(--spaghetti-brown);
}
/* Override default prose styles that conflict with our theme */
.prose {
color: var(--spaghetti-brown);
}
.prose a {
color: var(--spaghetti-red);
}
.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
color: var(--spaghetti-brown);
}
.prose code {
color: var(--spaghetti-brown);
}
.prose pre {
background-color: var(--spaghetti-cream);
}
.prose blockquote {
border-left-color: var(--spaghetti-yellow);
}
.prose th,
.prose td {
color: var(--spaghetti-brown);
}
.page-heading {
@apply font-semibold text-black dark:text-white;
}
.blend {
@apply transition-all duration-300 ease-in-out;
@@ -228,55 +388,144 @@ article {
transform: translateY(0);
}
article img {
padding-top: 20px;
padding-bottom: 20px;
display: block;
margin: 0 auto;
}
/**
* TWINKLE STARS
* PARMESAN FLECKS
*/
#twinkle-star.template {
#parmesan-fleck.template {
@apply absolute -left-full; /* hide offscreen */
}
#twinkle-star.twinkle {
@apply animate-twinkle; /* defined in tailwind.config */
#parmesan-fleck.fleck {
@apply animate-twinkle; /* defined in @theme above */
filter: drop-shadow(0 0 3px color-mix(in srgb, var(--color-parmesan) 55%, transparent));
}
/**
* Meteors
* Meatballs — shooting meatballs on trails of marinara
* The wrapper is the streak: its head (top edge) is the meatball, the sauce trails below it.
*/
#meteors .shower {
@apply absolute inset-0 top-0;;
#meatballs .shower {
@apply absolute inset-0 top-0;
@apply left-1/2 -translate-x-1/2;
@apply w-screen aspect-square;
}
#meteors .meteor {
@apply animate-meteor; /* defined in tailwind.config */
@apply absolute top-1/2 left-1/2 w-px h-[75vh];
@apply bg-gradient-to-b from-white to-transparent;
#meatballs .meatball {
@apply animate-meatball; /* defined in @theme above */
@apply absolute top-1/2 left-1/2;
/* --trail-length / --trail-width / --ball-size are set per instance by the script. */
width: var(--trail-width, 16px);
height: var(--trail-length, 40vh);
}
#meteors .shower.ur {
#meatballs .trail {
@apply absolute left-1/2 top-0;
width: var(--trail-width, 16px);
height: 100%;
transform: translateX(-50%);
background: linear-gradient(to bottom,
var(--color-marinara) 0%,
var(--color-marinara-dark) 45%,
transparent 100%);
clip-path: polygon(0 0, 100% 0, 62% 100%, 38% 100%);
filter: blur(1.2px);
opacity: .85;
}
/* Bright, freshly sauced core right under the meatball. */
#meatballs .trail::after {
content: "";
@apply absolute inset-0;
background: linear-gradient(to bottom,
rgba(255, 112, 86, .85) 0%,
rgba(226, 59, 44, .3) 30%,
transparent 62%);
clip-path: polygon(32% 0, 68% 0, 55% 100%, 45% 100%);
}
/* Anchor for the sphere; keeps the lighting fixed while the texture tumbles. */
#meatballs .ball {
@apply absolute left-1/2 top-0;
width: var(--ball-size, 12px);
height: var(--ball-size, 12px);
transform: translate(-50%, -50%);
overflow: hidden;
border-radius: 46% 54% 51% 49% / 53% 47% 55% 45%; /* hand-rolled, never a perfect sphere */
background:
radial-gradient(circle at 31% 27%, color-mix(in srgb, var(--color-meatball) 15%, #FFD6AA) 0 9%, transparent 44%),
radial-gradient(circle at 72% 76%, rgba(0, 0, 0, .42) 0 26%, transparent 60%),
radial-gradient(circle at 50% 45%, var(--color-meatball) 0 40%, var(--color-meatball-mid) 72%, var(--color-meatball-dark) 100%);
box-shadow:
inset -1px -2px 3px rgba(20, 8, 4, .8),
inset 2px 2px 3px rgba(255, 200, 150, .16),
0 0 7px color-mix(in srgb, var(--color-marinara) 50%, transparent);
}
/* Seared crumb texture, rotating so the meatball looks like it tumbles in flight. */
#meatballs .ball::after {
content: "";
@apply absolute inset-0;
border-radius: inherit;
background:
radial-gradient(circle at 62% 34%, rgba(35, 16, 8, .75) 0 7%, transparent 8%),
radial-gradient(circle at 34% 62%, rgba(35, 16, 8, .65) 0 6%, transparent 7%),
radial-gradient(circle at 55% 70%, rgba(140, 88, 52, .55) 0 5%, transparent 6%),
radial-gradient(circle at 22% 38%, rgba(140, 88, 52, .5) 0 4%, transparent 5%);
animation: var(--animate-tumble);
}
/* Sauce droplets flung to the sides of the stream. Offsets are fractions of the trail, so they
stay put however long or wide a streak is. The dot itself is invisible; only shadows are drawn. */
#meatballs .splatter {
@apply absolute left-1/2 top-0 rounded-full;
--spray: max(11px, calc(var(--trail-width, 16px) * 1.1));
width: 3px;
height: 3px;
background: transparent;
opacity: .8;
filter: blur(.35px);
}
#meatballs .meatball.v1 .splatter {
box-shadow:
calc(var(--spray) * -1) calc(var(--trail-length, 40vh) * .3) 0 -1px var(--color-marinara),
var(--spray) calc(var(--trail-length, 40vh) * .48) 0 -.5px var(--color-marinara-dark),
calc(var(--spray) * -1.5) calc(var(--trail-length, 40vh) * .66) 0 -.5px rgba(179, 38, 30, .7),
calc(var(--spray) * 1.2) calc(var(--trail-length, 40vh) * .84) 0 -1px rgba(226, 59, 44, .5);
}
#meatballs .meatball.v2 .splatter {
box-shadow:
var(--spray) calc(var(--trail-length, 40vh) * .26) 0 -.5px var(--color-marinara-dark),
calc(var(--spray) * -1.3) calc(var(--trail-length, 40vh) * .44) 0 -1px var(--color-marinara),
calc(var(--spray) * 1.6) calc(var(--trail-length, 40vh) * .62) 0 -.5px rgba(179, 38, 30, .65),
calc(var(--spray) * -1.1) calc(var(--trail-length, 40vh) * .86) 0 -.5px rgba(226, 59, 44, .45);
}
#meatballs .meatball.v3 .splatter {
box-shadow:
calc(var(--spray) * -1.6) calc(var(--trail-length, 40vh) * .34) 0 -1px var(--color-marinara-dark),
calc(var(--spray) * 1.2) calc(var(--trail-length, 40vh) * .5) 0 -.5px var(--color-marinara),
calc(var(--spray) * 1.05) calc(var(--trail-length, 40vh) * .7) 0 -1px rgba(179, 38, 30, .6),
calc(var(--spray) * -1.35) calc(var(--trail-length, 40vh) * .9) 0 -1.5px rgba(226, 59, 44, .4);
}
#meatballs .shower.ur {
@apply rotate-45;
}
#meteors .shower.dr {
#meatballs .shower.dr {
@apply rotate-135;
}
#meteors .shower.dl {
#meatballs .shower.dl {
@apply rotate-225;
}
#meteors .shower.ul {
#meatballs .shower.ul {
@apply rotate-315;
}
@@ -291,5 +540,7 @@ article img {
}
.copy-svg {
@apply w-full aspect-square text-white opacity-70 hover:opacity-90;
/* The button sits inside the code block, whose background is now the light
`code-bg` token in light mode. `text-white` was invisible there (1.1:1). */
@apply w-full aspect-square text-ink-muted opacity-70 hover:opacity-90;
}
+15 -1
View File
@@ -7,14 +7,28 @@ export interface Site extends Page {
AUTHOR: string
}
/**
* A nav entry. HREF may be site-relative (Home, Work, Blog, Projects) or an
* absolute off-site URL (Docs → docs.spaghet.io). EXTERNAL marks the off-site
* entries so the renderers can add target/rel and skip active-page styling;
* it is intentionally explicit rather than sniffed at call sites so the two
* navs (Header.astro, Drawer.astro) can never disagree.
*/
export type Links = {
TEXT: string
HREF: string
EXTERNAL?: boolean
}[]
export type Cta = {
TEXT: string
HREF: string
ICON: string
}
export type Socials = {
NAME: string
ICON: string
TEXT: string
HREF: string
}[]
}[]
Loaded 100 of 102 files, more files were not shown because too many files have changed in this diff. Show more