diff --git a/CLAUDE.md b/CLAUDE.md deleted file mode 120000 index eada936..0000000 --- a/CLAUDE.md +++ /dev/null @@ -1 +0,0 @@ -CONTRIBUTING.md \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e58180f..170c818 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -61,7 +61,7 @@ Domain routing is handled by Cloudflare Pages Functions middleware (`functions/_ - Microsite layouts are standalone HTML documents — they do NOT extend `DefaultLayout` or import `global.css` - Each microsite has fully independent styling (no shared design tokens or utility classes) -- Static assets use `/<name>/` prefixed paths (e.g. `/hands/images/human-hands.jpg`) +- Static assets use `//` prefixed paths (e.g. `/hands/images/human-hands.jpg`) - Each microsite has its own `robots.txt.ts`, `sitemap.xml.ts`, and `404.astro` - The main site's sitemap excludes microsite paths via the `filter` option in `astro.config.mjs` - Middleware does NOT run in local dev — access microsites at `localhost:4321//` diff --git a/README.md b/README.md index acdc8bf..ba8cf34 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,29 @@ This repo also hosts standalone microsites, each with its own domain, layout, an - **[useyourdamnhands.com](https://useyourdamnhands.com)** — A public service announcement about unnecessary tools - **[whatarewedoinghere.org](https://whatarewedoinghere.org)** — Coming soon -Microsites live under `src/microsites//` (layouts, components, styles) and `src/pages//` (routes). Domain routing is handled by Cloudflare Pages Functions middleware (`functions/_middleware.ts`). +Domain routing is handled by Cloudflare Pages Functions middleware (`functions/_middleware.ts`). There are two ways to create a microsite: + +#### Option A: Single index.html (simple) + +For lightweight microsites that don't need Astro's build pipeline: + +1. Create `src/pages//index.html` — Astro treats raw `.html` files in `src/pages/` as page routes without any processing. The file is served at `//` in both dev and production. +2. To attach a custom domain, add an entry to `MICROSITES` in `functions/_middleware.ts`: + ```ts + { prefix: '/', domain: 'example.com' } + ``` + +`src/pages/useless-box/index.html` is a minimal example that renders a red box. + +#### Option B: Full Astro microsite (complex) + +For microsites that need components, data, TypeScript, or multiple routes: + +- `src/microsites//` — layouts, components, data, styles (not routed by Astro) +- `src/pages//` — page routes (`index.astro`, `404.astro`, `robots.txt.ts`, `sitemap.xml.ts`) +- `public//` — static assets (images, favicon) + +After adding routes under `src/pages//`, exclude the prefix from the main sitemap in `astro.config.mjs` and register the domain in the middleware as above. ### Themes @@ -59,7 +81,7 @@ Themes are defined in `src/themes/` as TypeScript files satisfying the `Theme` i ### Requirements -- [Node.js](https://nodejs.org/) 22+ +- [Node.js](https://nodejs.org/) 22+ - install via `brew install node` (assuming you have Homebrew installed) - [pnpm](https://pnpm.io/) — install via `corepack enable pnpm` ### Quick Start diff --git a/astro.config.mjs b/astro.config.mjs index 5309f44..6ccba6d 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -6,7 +6,7 @@ import { rehypeLazyImages } from './src/utils/rehypeLazyImages'; export default defineConfig({ site: 'https://tinney.dev', - trailingSlash: 'never', + trailingSlash: 'ignore', integrations: [ sitemap({ filter: (page) => !page.includes('/hands/') && !page.includes('/whatarewedoinghere/'), diff --git a/functions/_middleware.ts b/functions/_middleware.ts index 6147a75..b8d67fa 100644 --- a/functions/_middleware.ts +++ b/functions/_middleware.ts @@ -9,10 +9,7 @@ interface CFContext { env: { ASSETS: { fetch: (req: Request | URL | string) => Promise } }; } -const MICROSITES: MicrositeRoute[] = [ - { prefix: '/hands', domain: 'useyourdamnhands.com' }, - { prefix: '/whatarewedoinghere', domain: 'whatarewedoinghere.org' }, -]; +const MICROSITES: MicrositeRoute[] = [{ prefix: '/hands', domain: 'useyourdamnhands.com' }]; function findMicrositeByHost(hostname: string): MicrositeRoute | undefined { return MICROSITES.find((m) => hostname === m.domain || hostname === `www.${m.domain}`); diff --git a/public/useless-box/images/dark-wood.png b/public/useless-box/images/dark-wood.png new file mode 100644 index 0000000..95e5c54 Binary files /dev/null and b/public/useless-box/images/dark-wood.png differ diff --git a/public/useless-box/images/off.png b/public/useless-box/images/off.png new file mode 100644 index 0000000..1838637 Binary files /dev/null and b/public/useless-box/images/off.png differ diff --git a/public/useless-box/images/on.png b/public/useless-box/images/on.png new file mode 100644 index 0000000..366b22b Binary files /dev/null and b/public/useless-box/images/on.png differ diff --git a/public/useless-box/images/robot-hand.png b/public/useless-box/images/robot-hand.png new file mode 100644 index 0000000..1cc3220 Binary files /dev/null and b/public/useless-box/images/robot-hand.png differ diff --git a/public/useless-box/images/wood.png b/public/useless-box/images/wood.png new file mode 100644 index 0000000..1628453 Binary files /dev/null and b/public/useless-box/images/wood.png differ diff --git a/public/useless-box/sounds/switch.mp3 b/public/useless-box/sounds/switch.mp3 new file mode 100644 index 0000000..e912f31 Binary files /dev/null and b/public/useless-box/sounds/switch.mp3 differ diff --git a/src/data/projects.json b/src/data/projects.json index 99bbe43..1815d9a 100644 --- a/src/data/projects.json +++ b/src/data/projects.json @@ -7,6 +7,14 @@ "homepageUrl": "https://tinney.dev", "gitHubUrl": "https://github.com/cdtinney/tinney.dev" }, + { + "name": "useless-box", + "shortDescription": "A useless box.", + "techStack": ["HTML", "Cloudflare Pages"], + "homepageUrl": "https://tinney.dev/useless-box", + "micrositePath": "/useless-box", + "gitHubUrl": "https://github.com/cdtinney/tinney.dev" + }, { "name": "useyourdamnhands.com", "shortDescription": "A public service announcement about unnecessary tools.", diff --git a/src/pages/useless-box/index.html b/src/pages/useless-box/index.html new file mode 100644 index 0000000..6ec75e0 --- /dev/null +++ b/src/pages/useless-box/index.html @@ -0,0 +1,262 @@ + + + + + + Useless Box + + + +
+
+
+ Toggle switch +
+ +
+ Hand +
+
+ + + +