Astro Blog with Nx Monorepo
I had been thinking about migrating my WordPress blog into something more developer-oriented. WordPress is great β battle-tested, popular, and has a plugin for everything β but itβs not built for people like me who want full control over their content and workflow.
β My Wishlist
Section titled ββ My WishlistβWhat I really wanted was a blog system that would let me:
- βοΈ Write posts in Markdown
- π§³ Work comfortably from my tablet (via GitHub Mobile or Codespaces)
- βοΈ Build into static pages (fast + SEO-friendly)
- π Display posts in reverse chronological order like a traditional blog
- π Deploy via CI (GitHub Actions) and host on GitHub Pages or similar tooling
π§ Enter Astro + Starlight
Section titled βπ§ Enter Astro + StarlightβAfter evaluating a few static site generators, I chose Astro, using the Starlight Rapide theme. The reasons were simple:
- Fast static builds
- Clean, minimal layout
- Native Markdown support
- Easy to host and maintain
- Content collections for typed Markdown posts
π§± Keeping It Inside a Monorepo
Section titled βπ§± Keeping It Inside a MonorepoβI already had an Nx workspace (rishabhmhjn-srcs
) where I plan to keep all my projects. I added the Astro blog as an app inside apps/rishabhmhjn.com
.
Each blog post lives under src/content/blog/
, with frontmatter like:
---title: "My First Post"pubDate: 2025-07-15description: "This is the first post on my new Astro blog!"tags: ["astro", "starter"]---
This setup makes it super easy to write and commit from anywhere β even on mobile.
π CI/CD with GitHub Actions + Pages
Section titled βπ CI/CD with GitHub Actions + PagesβI created a GitHub Actions workflow that builds the Astro site and deploys to GitHub Pages. The steps are simple:
- Install dependencies
- Run astro build (wrapped in Nx)
- Deploy
dist/projects/rishabhmhjn.com
usingpeaceiris/actions-gh-pages
More at .github/workflows/rishabhmhjn.com.yml
I verified my custom subdomain on GitHub by:
- Adding a TXT record (_github-challenge-
) - Setting up a CNAME DNS record pointing astro.rishabhmhjn.com to rishabhmhjn.github.io
It now lives at https://astro.rishabhmhjn.com π
βπΌ Actual part of writing
Section titled ββπΌ Actual part of writingβI wanted to be able to perform some level of coding on my tablet and explore tools like codespaces. I am actually writing this blog on my tablet!