Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ blog. This file is the source of truth for conventions; read it before making ch

## What this is

- **Astro 6**, `output: "static"` — prerendered HTML. Deployed to **Cloudflare Workers
- **Astro 7**, `output: "static"` — prerendered HTML. Deployed to **Cloudflare Workers
Static Assets** (`./dist`). A thin Worker (`worker/index.ts`) sits in front purely for
`Accept: text/markdown` content negotiation; everything else is static. Fingerprinted
assets are still served directly (see `run_worker_first` in `wrangler.jsonc`).
Expand Down Expand Up @@ -230,6 +230,22 @@ visual changes, check at both mobile and desktop widths.

CI does **not** deploy; Cloudflare's Git integration deploys on push to `main`.

## Commits & PRs

- **Conventional Commits.** Every commit message follows the
[Conventional Commits](https://www.conventionalcommits.org/) spec:
`type(scope): summary` (e.g. `feat(feed): …`, `fix(og): …`,
`build(deps): …`, `docs: …`, `chore(config): …`). Use the same convention
for branch names.
- **Small, meaningful commits.** Split a change into focused commits that each
do one coherent thing (e.g. dependency bumps, config change, and docs as
separate commits) rather than one large catch-all. Each commit should build
and make sense on its own.
- **Verify before committing.** Run the [Build & verify](#build--verify) steps;
don't commit work that fails `check` or `build`.
- **Branch off `main`** for new work, open a PR, and let CI run. Cloudflare
deploys from `main` on merge — don't push directly to `main`.

## Do NOT touch (unless that's explicitly the task)

- `astro.config.mjs`, `tsconfig.json`, `wrangler.jsonc` — infra; change deliberately.
Expand All @@ -254,6 +270,10 @@ CI does **not** deploy; Cloudflare's Git integration deploys on push to `main`.
island (`client:visible`), which is handed the whole feed and reveals more posts in
place. "Load more" is a real link to `/…/page/N/`, so without JS it just navigates
there — those static `/page/N/` routes are the no-JS / crawler fallback, so keep them.
- Remark plugins are registered in `astro.config.mjs` via
`markdown.processor: unified({ remarkPlugins: [...] })` (NOT the deprecated
`markdown.remarkPlugins`); `shikiConfig` stays at the top-level `markdown` key.
- Astro 7's default Markdown processor is **Sätteri** (Rust). This blog opts back
into the **unified (remark/rehype)** pipeline because its remark plugins are
unified plugins: `markdown.processor: unified({ remarkPlugins: [...] })` in
`astro.config.mjs`, with `unified` imported from the explicitly-installed
**`@astrojs/markdown-remark`** dependency (Astro 7 no longer bundles it).
`shikiConfig` stays at the top-level `markdown` key. `compressHTML: true` is
pinned to keep v6 whitespace behavior (Astro 7's default is `'jsx'`).
9 changes: 8 additions & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export default defineConfig({
output: 'static',
// Trailing slashes on every URL (enforced globally).
trailingSlash: 'always',
// Astro 7 changed the default from `true` to `'jsx'` (collapses whitespace
// between inline elements using JSX rules). Pin to `true` to keep the exact
// v6 HTML/whitespace behavior — this blog preserves its established look.
compressHTML: true,
build: {
// Emit /slug/index.html so URLs are /slug/.
format: 'directory',
Expand Down Expand Up @@ -46,7 +50,10 @@ export default defineConfig({
stripImageMetadata(),
],
// Code blocks highlighted by Shiki with the Nord theme.
// remark plugins via processor API (markdown.remarkPlugins is deprecated in Astro 6.4+).
// Astro 7's default Markdown processor is Sätteri (Rust); we opt back into the
// unified (remark/rehype) pipeline via `processor: unified()` from the
// explicitly-installed @astrojs/markdown-remark, since our remark plugins
// (video embeds, image captions) are unified plugins.
// shikiConfig stays at top-level markdown (unified() does not forward it to Shiki).
markdown: {
processor: unified({
Expand Down
Loading
Loading