Skip to content

docs: move the docs site from MkDocs Material to Astro Starlight - #362

Merged
chhoumann merged 26 commits into
masterfrom
docs/starlight
Oct 11, 2026
Merged

chhoumann merged 26 commits into
masterfrom
docs/starlight

Conversation

@chhoumann

@chhoumann chhoumann commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

Why

MkDocs Material reaches end of life on 2026-11-05. This PR moves podnotes.obsidian.guide to Astro Starlight and keeps the pages' content and URLs the same. The layout follows QuickAdd's Starlight docs.

What changed

  • docs/ is now a standalone npm package (Astro 7, Starlight 0.42) with its own lockfile. Pages live in docs/src/content/docs/, and images in docs/public/resources/ keep their old /resources/* URLs.
  • The site has Pagefind search, dark mode, edit links, the old nav as its sidebar, a sitemap, llms.txt, raw markdown at <page>.md, and OG tags. starlight-links-validator fails the build on a broken internal link or anchor, and the content schema fails it when a page lacks slug:.
  • Python is gone. The Documentation workflow, Dependabot and the release workflow now use npm and the Node version from .nvmrc.
  • Two small endpoints generate llms.txt and llms-full.txt instead of starlight-llms-txt, whose braces dependency has an unpatched high advisory that fails Dependency Review. An npm override moves Starlight's postcss-nested to 7 for the patched selector parser (GHSA-rj75-hqrm-r3gf). The built site is byte-identical with and without the override.

Scope

  • Page content is unchanged. The only page edits are frontmatter, H1s moved into titles, site-absolute links, em-dashes replaced, and one blank line removed that spread a list apart.
  • New guides, videos and a PodNotes favicon are left for later units.
  • Every heading fragment from the MkDocs site still works. Six old ids had no Starlight equivalent (two headings with / or &, and four H1s that moved into frontmatter), so empty spans inside the two headings and a legacyTitleId frontmatter field (rendered by a PageTitle override) keep them. Old links land exactly where the new ids do, and the aliases add no space. docs/scripts/legacy-fragments.mjs checks all 73 ids from master's MkDocs build after every docs build.
  • Starlight's smart typography stays on. It curls quotes and apostrophes in prose only: no template tag sits outside a code span, and no code span or block in the build contains a curly character.

Blast Radius

Cloudflare Pages builds this repo with docs/ as its root directory. Its build command is now pip install -r docs/requirements.txt; npm run docs:build: pip fails harmlessly once docs/requirements.txt is gone, and npm run docs:build resolves to docs/package.json, where it aliases build. docs/wrangler.jsonc sets the output to dist. The PR preview deploy is green. After merge, the dashboard command can drop to npm run docs:build or npm run build.

The release workflow changes only by dropping its Python inputs, because docs/requirements.txt no longer exists. The root README's image paths follow the moved files, and its docs links now point at podnotes.obsidian.guide instead of a stale GitHub Pages copy.

Verification

  • npm run lint, format:check, typecheck, build, test (1153 tests) and docs:build pass on Node 22.23.2. docs:build fails on a broken link or anchor, a page without slug:, a page missing from the sidebar, and a removed legacy anchor (each tested).
  • In a browser, /import_export/#settings-templates and /commands/#capture-last-10-seconds-capture-last-20-seconds scroll to their sections, and the aliases add no layout shift (0px, measured on all six pages at desktop and phone width).
  • A local preview walk found every old page URL serving 200. All 19 images load, every edit link points at its file, search returns results, and dark mode renders.
  • Two reviewers (Claude Fable 5.1 and GPT-6 Astra) reviewed the full diff and then the fixes.
Before (MkDocs) After (Starlight)
Home, desktop
Templates, desktop
Home, phone
Templates, phone

Pages move from docs/docs/ to docs/src/content/docs/ and images from
docs/docs/resources/ to docs/public/resources/, unchanged. The repo README
points at the new image paths because Obsidian's plugin browser renders it.
Each page gets title and slug frontmatter. Leading H1s move into title.
Relative .md links and resources/ image paths become site-absolute, and
em-dashes become plain dashes. No other content changes.
docs/ becomes a standalone npm package (own package-lock.json) that builds
with Astro Starlight into docs/dist. Every URL the MkDocs site served stays
the same, and /sitemap.xml redirects to /sitemap-index.xml.

- A build-time check fails when a page has no slug: frontmatter, so URLs
  such as /QuickAdd/ cannot silently change case.
- starlight-links-validator fails the build on a broken internal link or
  anchor.
- starlight-llms-txt writes llms.txt files, and every page is also served
  as raw markdown at <page-url>.md.
- docs:build installs and builds the docs package; wrangler.jsonc and
  docs:deploy publish docs/dist.
The Documentation workflow sets up Node from .nvmrc with the docs lockfile
as the npm cache key, and also runs when package.json or .nvmrc change.
Dependabot tracks the docs npm package instead of pip. The release
workflow no longer installs Python or the deleted requirements file.
The schema rejects a page without slug: at load time, in builds and in astro dev, so the custom config-time file scan goes. Also drops the twitter:card entry Starlight already emits, types the raw-markdown endpoint props, and removes a .gitignore line the root node_modules rule covers.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Deploying podnotes with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6bcf749
Status: ✅  Deploy successful!
Preview URL: https://7625be88.podnotes.pages.dev
Branch Preview URL: https://docs-starlight.podnotes.pages.dev

View logs

# Conflicts:
#	.github/dependabot.yml
#	.github/workflows/documentation.yml
starlight-llms-txt pulls braces through micromatch, and every braces release is affected by GHSA-vfj7-8cjw-p6xm (high, no patch), which fails the required Dependency Review check. Two small endpoints now write /llms.txt (every page in sidebar order, linked as raw markdown) and /llms-full.txt from the same page markdown as /<page>.md. The sidebar moves to src/site.mjs so the config and the endpoints share one page order.
…rser

Starlight's code highlighter (@expressive-code/core) pins postcss-nested 6, whose postcss-selector-parser 6.1.4 is affected by GHSA-rj75-hqrm-r3gf (moderate; fixed in 7.1.6). postcss-nested 7 only drops Node 12-16 and depends on the 7.x parser. The built site is byte-identical with and without the override, and npm audit in docs/ reports no vulnerabilities. Drop the override once expressive-code moves to postcss-nested 7.
llms.txt and llms-full.txt list pages from the sidebar, so a page left out of it would silently drop out of both while still serving its raw .md. The site title also moves into src/site.mjs next to the description and sidebar.
Starlight drops a hyphen differently from MkDocs on two headings, and moving four H1s into frontmatter removed their ids, so six old section links landed at the page top. Empty <div id> anchors restore them, and the raw markdown endpoints strip the anchors. scripts/legacy-fragments.mjs checks every heading id from master's MkDocs build (legacy-fragments.json, 73 ids) against each new build and fails the docs build when one has no target.
Empty <div id> anchors at the top of a page became its first block, so the first paragraph took Starlight's 16px block gap and the page shifted down. Old page-title ids now come from a legacyTitleId frontmatter field that a PageTitle override wraps around the title, and old section ids are empty spans inside their headings. Both land exactly where the new ids do and add no space.
The Pages project builds with docs/ as its root directory, so it never read the repo-root wrangler.jsonc, and npm run docs:build resolved to docs/package.json. wrangler.jsonc moves into docs/ with dist as the output directory, and docs/package.json aliases docs:build to build, so the current dashboard command builds the Starlight site.
@chhoumann
chhoumann merged commit 96093b9 into master Oct 11, 2026
12 checks passed
@chhoumann
chhoumann deleted the docs/starlight branch October 11, 2026 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant