A minimal, editorial Astro theme inspired by calm personal blogs and designed for technical writing.
- Structured front page with sectioned lists (Posts + Micro)
- Content collections with typed frontmatter (
posts,micro) - Responsive reading width (optimized around
880pxcontent column) - Optional sticky left TOC on long-form post pages
- Light/dark mode with persistent preference (
localStorage) - Clearly-marked sample content included so the theme works out of the box
npm install
npm run devsrc/layouts/BaseLayout.astro— metadata, shell, and global headersrc/components/Header.astro— minimal top navigationsrc/components/ThemeToggle.astro— client-side theme switchingsrc/pages/— homepage, list pages, and dynamic content routessrc/content/— sample posts and micro notes
npm run check
npm run buildAll files under src/content/ are intentionally demo placeholders so you can safely replace them.
This repo now supports two Astro deployments from one repository:
- Production:
main/masterbranch →gh-pagesroot - Development preview:
devbranch →gh-pages/preview/
For a project site, URLs are typically:
- Prod:
https://sudheer.github.io/marcus-astro/ - Dev:
https://sudheer.github.io/marcus-astro/preview/
Yes, this is mostly a one-time setup.
- Open Actions and run Bootstrap gh-pages branch once.
- This creates
gh-pagesso it appears in Pages branch selection.
- This creates
- Open Settings → Pages in your repository.
- Under Build and deployment, choose:
- Source:
Deploy from a branch - Branch:
gh-pages - Folder:
/(root)
- Source:
- Save.
After that:
- pushing to
main/masterruns.github/workflows/deploy-prod.yml - pushing to
devruns.github/workflows/deploy-dev.yml
The workflows publish to the same gh-pages branch, with prod at root and dev under /preview/.
A pull request preview workflow is included at .github/workflows/preview.yml.
When you open or update a PR:
- GitHub Actions builds the site for that PR.
- It deploys to
gh-pages/preview/pr-<PR_NUMBER>/. - It comments a direct preview URL on the PR.
Preview URL format:
https://sudheer.github.io/marcus-astro/preview/pr-<PR_NUMBER>/
This provides a clickable live URL for each PR without using the alpha GitHub Pages preview feature.
If https://sudheer.github.io/marcus-astro/preview/ shows 404, it usually means Pages is reading the wrong branch.
Verify this exact setup:
- Settings → Pages
- Source =
Deploy from a branch - Branch =
gh-pages - Folder =
/(root) - Save
Then run:
- Actions → Deploy development site (manual run is okay) to publish
/preview/ - Actions → Deploy production site to refresh root site
Important: if Pages is set to any branch other than gh-pages (for example your feature branch), /preview/ will not exist there and returns 404.
GitHub only shows existing branches in Pages settings. If gh-pages was never created, it will not appear in the dropdown. Running the bootstrap workflow once fixes that.
If GitHub logs show Invalid YAML front matter ... .astro, your repo is being built by the default pages build and deployment (Jekyll) job on source branch files.
Fix:
- Set Settings → Pages → Source to
Deploy from a branch - Select branch
gh-pages, folder/(root) - Run Bootstrap gh-pages branch once (if missing)
- Re-run deploy workflows
This repository also includes _config.yml + .nojekyll fallback to avoid Jekyll parsing Astro source if branch configuration is temporarily incorrect.
That means repository Pages is currently configured to build from the docs/ folder.
This repo now includes a minimal docs/index.md so that configuration no longer fails with No such file or directory ... /docs.
Still recommended for Astro deployments:
- Settings → Pages
- Source:
Deploy from a branch - Branch:
gh-pages - Folder:
/(root)
Astro static assets are emitted under /_astro/. On GitHub Pages, if .nojekyll is missing in the published output, Jekyll can ignore underscore-prefixed folders and assets may 404.
Deploy workflows now write dist/.nojekyll before publish (prod/dev/PR preview) to keep preview links working correctly.
PR preview workflow now:
- Ensures
gh-pagesexists (bootstraps if missing) - Deploys PR build to
/preview/pr-<PR_NUMBER>/ - Verifies URL returns HTTP 200 before posting the preview link
- Posts a failure comment with exact Pages setting fixes if the URL is unreachable
This repo now uses the official Astro GitHub Action (withastro/action) for setup/build steps, while keeping branch-based publish to gh-pages for prod/dev/PR preview paths.
withastro/action requires explicit package manager when a lockfile is not present. Workflows are configured with package-manager: npm to avoid setup failures.