This monorepo for all my *.chiubaca.com sites.
- What it is: The public website for chiubaca.com built with Astro and deployed to Cloudflare.
- Notable config:
astro.config.tsuses Cloudflare adapter and custom remark plugins fromlibs/remark-pluginsto rewrite Markdown links and images.wrangler.jsoncserves the builtdist/at the custom domainchiubaca.com.
- Content sources:
apps/chiubaca.com/fleeting-notes/andapps/chiubaca.com/permanent-notes/- Attachments copied to
apps/chiubaca.com/public/attachments/
- Package scripts (in
apps/chiubaca.com/package.json):dev— Runsastro devthenwrangler dev(sequential). Use when iterating locally.build— Builds static site withastro buildintodist/.preview— Serves the built site withastro preview.deploy— Deploys the built site viawrangler deploy.format— Formats./srcwith Biome.
- What it is: A Cloudflare Worker that fronts/forwards to chiubaca.com.
/proxies tohttps://chiubaca.com/fleeting-notes/and injects a<base href="/fleeting-notes/">tag into HTML responses so relative links resolve correctly.- Other paths proxy through to
https://chiubaca.com/*.
- Notable config:
wrangler.jsoncroutes the worker to the custom domainnotes.chiubaca.com.src/index.tscontains the proxy logic and base-tag injection usingHTMLRewriter.
- Package scripts (in
apps/notes.chiubaca.com/package.json):dev/start— Runswrangler devfor local development.deploy— Publishes the worker withwrangler deploy.test— Runsvitestwith the Cloudflare Workers pool.cf-typegen— Generates type definitions forEnvbindings viawrangler types.
Custom remark plugins used by apps/chiubaca.com during Markdown processing (exported via libs/remark-plugins/index.ts):
updateMdLinkUrls— Converts Obsidian-style Markdown links that end with.mdinto absolute site paths without the extension.- Example:
fleeting-notes/2022-01-01.md→/fleeting-notes/2022-01-01.
- Example:
updateImageUrls— Rewrites local Markdown image URLs to absolute site paths under/attachments/(skips externalhttpsimages).- Example:
some/folder/image.png→/attachments/image.png.
- Example:
Copies notes and assets from a temporary clone into the website app:
- Copies
tmp-notes/permanent-notes/→apps/chiubaca.com/permanent-notes/ - Copies
tmp-notes/fleeting-notes/→apps/chiubaca.com/fleeting-notes/ - Copies
tmp-notes/attachments/*→apps/chiubaca.com/public/attachments/
All scripts below live in the root package.json and are intended to be run from the repo root with pnpm run <script>.
dev— Runspnpm -r devto startdevin all workspace apps.▶️ dev:chiubaca— Runsdevfor thechiubaca.comapp only via a filter. 🎯notes:download—git clonethe external notes repo intotmp-notes/(fresh clone; removes existingtmp-notes/). ⬇️notes:sync—git pullinsidetmp-notes/to update the cloned notes. 🔄notes:migrate— Runsbash libs/scripts/migrate-notes.shto copy notes and attachments into the website app. 🧳chiubaca.com:build— Runsnotes:download+notes:migrate, then buildsapps/chiubaca.com. 🏗️chiubaca.com:deploy— Runs thedeployscript inapps/chiubaca.com. 🚀preview— Runspnpm -r previewacross workspace apps. 👀lint—biome lint --write .to apply lint fixes. 🧹lint:fix—biome check --write .(Biome’s check/fix mode across the repo). 🔧test:node-env— Prints Node path and version for debugging. 🧪
pnpm run notes:download— Clone notes intotmp-notes/.pnpm run notes:migrate— Copy Markdown and attachments intoapps/chiubaca.com.pnpm run chiubaca.com:build— Build site with the migrated content.pnpm run chiubaca.com:deploy— Deploy to Cloudflare.
- Package manager:
pnpm@10.11.0(declared in the rootpackage.json). - Workspace packages:
apps/*(seepnpm-workspace.yaml). Thelibs/directory provides shared source and scripts, not standalone packages.