Skip to content

Erin/astro switch#368

Merged
erinxocon merged 28 commits into
masterfrom
erin/astro-switch
Jun 11, 2026
Merged

Erin/astro switch#368
erinxocon merged 28 commits into
masterfrom
erin/astro-switch

Conversation

@erinxocon

@erinxocon erinxocon commented Jun 8, 2026

Copy link
Copy Markdown
Member

Migrate docs site from mdbook to Astro Starlight

This PR replaces the mdbook setup with Astro Starlight, giving us a modern, actively maintained docs framework with better theming, sidebar control, and a dev container for local development.

Framework migration

  • Replace book.toml with astro.config.mjs; add package.json, pnpm-lock.yaml, pnpm-workspace.yaml
  • Tech stack: TypeScript, Node 24, pnpm 11

Dev container

  • Add .devcontainer/Dockerfile and devcontainer.json for reproducible local dev

Content reorganization

  • Move all docs under src/content/docs/ to match Astro's content collections structure
  • Rename root README.md files to index.md so it serves as a landing page, and rename section README.md files to specs.md
  • Migrate first headings to frontmatter title fields

Custom plugins & utilities

  • SUMMARY.md sidebar converter — utility script that parses the existing SUMMARY.md into a Starlight sidebar config, preserving existing structure without a full content rewrite
  • Relative link plugin — adds proper relative-link support for markdown files in content collections
  • Image wrapper plugin — wraps every <img> with a link to the original full-size file
  • Custom AVIF image service (avifImageService.mjs)
  • Custom middleware for ToC modifications

Styling

  • CSS overrides for System76 brand colors and sidebar label styles
  • ToC width fix (toc-width-fix.css)
  • Image border radius (img-background.css)
  • Light/dark System76 logo assets added to src/assets/img/

CI/CD

  • Update ci.yml, deploy-prod.yml, and deploy-staging.yml for Astro build pipeline
  • Add build caching step in production deploy
  • Switch compression from gzip to zst
  • Pin GitHub Action versions to commit hashes instead of tags to mitigate supply chain attacks
  • Add Dependabot config for GitHub Actions and pnpm package updates

Misc

  • Rename entries titled "readme" to "specifications" in grouped sidebar sections
  • Override static slugs for articles whose paths contain periods (Astro's docs loader drops them)
  • Set baseUrl since the site is hosted at /tech-docs

@erinxocon erinxocon force-pushed the erin/astro-switch branch 6 times, most recently from 909d733 to 6db293e Compare June 10, 2026 03:55
@erinxocon erinxocon force-pushed the erin/astro-switch branch 5 times, most recently from 8532748 to 8887477 Compare June 11, 2026 17:53
erinxocon and others added 18 commits June 11, 2026 12:04
typescript, node24, and pnpm11 as our tech stack
(*) don't run under root and update remote user id so i don't have perms issues in parent file system

(*) if image format is not specified, use avif for MAXIMUM POWER

(*) add remark for marsing mdd into AST tree so we can dynamically create the sidebar
… script to convert the SUMMARY.md file to a sidebar js object starlight can underatand.

(+) pass in the location of the summary file

(+) add a script to convert all existing documents to mdx files with a proper frontmatter title so  starlight can read it

(*) move files to new location for astro content dir

(*) simpler migration script
… so we can make it the main page

(*) remove remark frontmatter
…ccessed original size image

(*) package update

(*) update astro config

(*) we no longer need this file

(*) move favicon to proper place

(*) add unified for plugin type defitions

(*) migrate plugin to a typescript file with proper signature for remark plugin type
… to overview since section title already includes the model number
…r for docs loader is dropping the period, so we override it with a static slug to keep it so links work

(*) do not process svg's under sharp pipeline or wrap them in links since they go unoptimized
(*) let package.json specify the version of pnpm

(*) use s3 cache which I've prepopulated

(+) add prettier for ci steps to ensure things are formatted
… items look like labels that do have sub items

(*) type the prettier config file to see proper options and option types

(+) add blame ignore revs for huge format commits
(*) update with another format rev

(*) update ci file for new workflow

(*) remove staging

(*) drop the box shadow, add padding and margins
(*) pnpm 11 is only available with node version 24
supply chain attacks

(*) commit hases instead of tag numbers to avoid supply chain attack

(*) use frozen lockfile so job fails if the lock file and package.json are out of sync
@erinxocon erinxocon force-pushed the erin/astro-switch branch from 8887477 to 10612f3 Compare June 11, 2026 18:04
@erinxocon erinxocon marked this pull request as ready for review June 11, 2026 18:05
@jacobgkau jacobgkau requested a review from a team June 11, 2026 18:05
@jacobgkau jacobgkau self-assigned this Jun 11, 2026

@jacobgkau jacobgkau left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Staging has all of the tweaks we've been working on recently. Looks good to me.

@erinxocon erinxocon merged commit 8acf2d2 into master Jun 11, 2026
2 checks passed
@erinxocon erinxocon deleted the erin/astro-switch branch June 11, 2026 18:38
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.

2 participants