A minimal blog built with Astro and deployed to GitHub Pages.
- Write posts in Markdown
- Automatic deployment via GitHub Actions
- Clean, minimal design
- Responsive layout
- Zero-cost hosting
npm install
npm run devVisit http://localhost:4321 to see your blog locally.
- Create a new Markdown file in
src/content/blog/ - Add frontmatter with required fields:
---
title: Your Post Title
description: A brief description (optional)
pubDate: 2024-12-30
---
Your content here...- Write your content in Markdown
- Commit and push to GitHub
- The site will automatically rebuild and deploy
├── src/
│ ├── content/
│ │ └── blog/ # Blog posts (Markdown files)
│ ├── layouts/ # Page layouts
│ ├── components/ # Reusable components
│ └── pages/ # Astro pages
├── public/ # Static assets
└── .github/
└── workflows/ # GitHub Actions workflows
The blog automatically deploys to GitHub Pages when you push to the main branch. The deployment is handled by GitHub Actions (see .github/workflows/deploy.yml).
- Go to your repository settings on GitHub
- Navigate to Pages
- Under "Source", select "GitHub Actions"
- Your site will be available at
https://YOUR_USERNAME.github.io/Blog
Update astro.config.mjs with your GitHub username:
export default defineConfig({
site: 'https://YOUR_USERNAME.github.io',
base: '/Blog',
// ...
});The blog uses scoped CSS in Astro components. Edit the <style> blocks in:
src/layouts/BlogLayout.astro- Main layout stylessrc/components/PostCard.astro- Post card stylessrc/pages/index.astro- Homepage stylessrc/pages/posts/[slug].astro- Post page styles
MIT