Why Astro?
Astro is the best framework for content-heavy sites in 2025. It generates pure static HTML β no JavaScript bloat β which means:
- β‘ Perfect Lighthouse scores
- π Excellent SEO out of the box
- π° Free hosting on Cloudflare Pages
Letβs build it.
Prerequisites
- Node.js 18+ installed
- A GitHub account
- A Cloudflare account (free)
Step 1: Create Your Astro Project
npm create astro@latest my-blog
cd my-blog
npm install
Choose the βblogβ template when prompted. It sets up everything you need.
Step 2: Run It Locally
npm run dev
Open http://localhost:4321 and youβll see your blog running.
Step 3: Push to GitHub
git init
git add .
git commit -m "initial commit"
gh repo create my-blog --public --push
Step 4: Deploy to Cloudflare Pages
- Go to pages.cloudflare.com
- Click Create a project β Connect to Git
- Select your GitHub repo
- Set build command:
npm run build - Set output directory:
dist - Click Save and Deploy
Your site will be live in under 2 minutes at a *.pages.dev URL.
Step 5: Connect Your Custom Domain
- In Cloudflare Pages β your project β Custom domains
- Add
nareshtech.net - Since your domain is already on Cloudflare Registrar, DNS updates automatically
Thatβs it. Your blog is live on your custom domain, with SSL, for free.
Writing Your First Post
Create a new file in src/pages/blog/:
---
title: "My First Post"
description: "A short description"
pubDate: "2025-01-20"
tags: ["Tag1", "Tag2"]
---
Your content here in Markdown.
Push to GitHub and Cloudflare auto-deploys in ~30 seconds.
Next Steps
- Set up Google Analytics
- Apply for Google AdSense
- Add affiliate links to your posts
Happy blogging! π