Skip to content

Set up Astro with GitHub Pages and migrate homepage from new-homepage branch#1966

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/set-up-astro-github-pages
Draft

Set up Astro with GitHub Pages and migrate homepage from new-homepage branch#1966
Copilot wants to merge 3 commits intomainfrom
copilot/set-up-astro-github-pages

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 27, 2026

Migrates the counterfact.dev homepage from Jekyll to Astro, deploying via GitHub Actions to GitHub Pages. The new-homepage branch's docs/index.html becomes the foundation.

Summary

Introduces a self-contained Astro v5 project under site/ with a layout/page split, wires up official GitHub Pages deployment, and migrates the dark-themed homepage HTML. CSS and JavaScript are kept in their own source files and bundled by Vite during build.

Original Prompt

We want to move this site to Astro and deploy it via GitHub Pages, using the existing index.html from the new-homepage branch as the foundation.

This should be done in a way that preserves the current homepage content while setting us up for future expansion (docs, additional pages, etc.).

Goals

  • Set up an Astro project in this repo
  • Configure deployment to GitHub Pages via GitHub Actions
  • Convert the existing index.html (from new-homepage) into an Astro layout/template
  • Use the existing homepage content as the site's root (/)

Manual acceptance tests

  • cd site && npm install && npm run dev — homepage renders with correct dark theme, nav, hero, and code sections
  • cd site && npm run build — exits 0, site/dist/ contains index.html, counterfact.svg, and CNAME
  • Preview with npm run preview — no broken assets, fonts load, SVG logo appears
  • Push to mainDeploy Site to GitHub Pages workflow passes in Actions
  • Visit https://counterfact.dev — visually matches new-homepage branch's docs/index.html

Tasks

  • site/ Astro projectpackage.json (astro v5.18.1), astro.config.mjs (static output, site: "https://counterfact.dev"), tsconfig.json, .gitignore
  • site/src/layouts/MainLayout.astro — HTML shell with <head>, Google Fonts links, and import "../styles/main.css"; exposes optional title prop
  • site/src/styles/main.css — ~900 lines of CSS extracted from the original inline <style> block
  • site/src/pages/index.astro — full body content from new-homepage/docs/index.html; curly braces in code examples escaped as &#123;/&#125; to prevent Astro template-expression misparse; references ../scripts/main.js via <script> import </script>
  • site/src/scripts/main.js — clipboard copy and IntersectionObserver JS extracted from the original inline <script> block
  • site/public/CNAME (counterfact.dev) and counterfact.svg; image src updated from ./counterfact.svg/counterfact.svg
  • .github/workflows/deploy-site.yaml — triggers on main push and workflow_dispatch; uses Node 22, npm ci, and the official configure-pages / upload-pages-artifact / deploy-pages action chain
  • .gitignore — excludes site/node_modules, site/dist, site/.astro
  • docs/index.html — synced to the new-homepage branch version

Copilot AI changed the title [WIP] Set up Astro with GitHub Pages and migrate homepage Set up Astro with GitHub Pages and migrate homepage from new-homepage branch Apr 27, 2026
Copilot AI requested a review from pmcelhaney April 27, 2026 23:38
Copy link
Copy Markdown
Collaborator

@pmcelhaney pmcelhaney left a comment

Choose a reason for hiding this comment

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

Extract the inline CSS and JS into files.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 27, 2026

Extract the inline CSS and JS into files.

Done in commit 27e46fe. The inline CSS is now in site/src/styles/main.css (imported via import "../styles/main.css" in the layout frontmatter), and the inline JS is in site/src/scripts/main.js (referenced via <script> import "../scripts/main.js"; </script> in the page). Both are bundled by Vite during npm run build.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • telemetry.astro.build
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/api-simulator/api-simulator/site/node_modules/.bin/astro build (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from pmcelhaney April 27, 2026 23:46
Comment thread site/src/scripts/main.js
@@ -0,0 +1,33 @@
function copyCmd() {
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.

Set up Astro with GitHub Pages and migrate homepage from new-homepage branch

2 participants