A minimal technical blog built with Astro, hosted on GitHub Pages.
npm install
npm run dev # http://localhost:4321Create a Markdown file in src/content/blog/:
---
layout: ../../layouts/Post.astro
title: "Your post title"
description: "Short summary for the home page listing."
pubDate: 2024-03-15
tags: ["tag1", "tag2"]
---
Post content here (Markdown + code blocks fully supported).Commit and push to main — GitHub Actions builds and deploys automatically.
- Create a new repository on GitHub
- In Settings → Pages, set source to GitHub Actions
- Edit
astro.config.mjs:- Set
sitetohttps://YOUR_USERNAME.github.io - Set
baseto/YOUR_REPO_NAME(omit if the repo isusername.github.io)
- Set
- Also update the site name in
src/layouts/Base.astroandsrc/pages/index.astro - Push:
git init
git remote add origin https://github.com/YOUR_USERNAME/YOUR_REPO_NAME.git
git add .
git commit -m "initial commit"
git push -u origin mainYour blog will be live at https://YOUR_USERNAME.github.io/YOUR_REPO_NAME.
src/
content/blog/ ← Markdown posts
layouts/
Base.astro ← site shell (header, footer)
Post.astro ← individual post layout
pages/
index.astro ← home / post listing
about.astro ← about page
styles/
global.css ← all styles
public/
favicon.svg
.github/workflows/
deploy.yml ← CI/CD pipeline