Skip to content

Move the site from Next.js to Astro - #1434

Merged
rasmusbe merged 3 commits into
mainfrom
astro
Oct 5, 2026
Merged

rasmusbe merged 3 commits into
mainfrom
astro

Conversation

@rasmusbe

@rasmusbe rasmusbe commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

The site is one static page and Next was only used to render it once (output: 'export'). Astro renders the same page, and React hydrates only Try and Generate.

What changed

  • index.astro and Layout.astro replace index.tsx, _app.tsx and _document.tsx. The GitHub fetch that was getStaticProps is now code at the top of index.astro.
  • Block, Implementations, Try and Generate are the same React components. Block and Implementations render to HTML without JS.
  • Tailwind runs through @tailwindcss/vite, the font comes from @fontsource-variable/source-sans-3.
  • The build fails if no .meta.yaml files could be fetched, instead of publishing an empty list.
  • deploy.yml uploads dist instead of out and caches npm through setup-node.
  • deploy.yml triggers: pull requests to main build without publishing. Pushes to main, manual runs and the schedule build and publish. The schedule runs every third hour around the clock (0 */3 * * *, UTC). The build falls back to github.token when PUSH_TOKEN is unavailable, as on fork pull requests.
  • npm run lint runs astro check. ESLint is removed together with eslint-config-next. npm run format also covers .astro through prettier-plugin-astro.

Comparison against main

Both versions were built from the same GitHub data.

Next Astro
Output 920 K 588 K
JS 476 K 255 K
js + css + html, gzip 165 K 92 K
node_modules 486 MB 261 MB
Build 6.8 s (cold) 2.1 s

Rendered text, links (142), images (69) and head tags are the same. All 30 measured elements (headings, tables, inputs) have the same position and size at 1024 px, and the page height is 2892 px in both.

One difference: Next adds 55 <link rel="preload"> tags for the badge and logo images. Astro does not, so they load as plain <img>. I have not measured which is faster.

The site is one static page, so Next was only used as a static generator. Astro renders the same page with React hydrating only Try and Generate.

- index.astro and Layout.astro replace index, _app and _document
- Tailwind through @tailwindcss/vite, font through fontsource
- Fail the build when no .meta.yaml files could be fetched
- Deploy dist instead of out, cache npm through setup-node
- Lint with astro check, format .astro files with prettier-plugin-astro
Pull requests to main build without uploading or deploying. The scheduled run now publishes too, so the implementation list refreshes. The build falls back to github.token when PUSH_TOKEN is unavailable, as on fork pull requests.
@rasmusbe
rasmusbe merged commit a57437e into main Oct 5, 2026
5 checks passed
@rasmusbe
rasmusbe deleted the astro branch October 5, 2026 08:28
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