This is the repository for my personal blog, where I document technical stuff and knowledge that I want to share with the world.
- Node.js 18+ and npm (or yarn/pnpm)
- Clone the repository:
git clone https://github.com/codesandtags/blog.git
cd blog- Install dependencies:
npm install- Start the development server:
npm run devThe blog will be available at http://localhost:4321
To add a new post, create a new markdown file in the src/content/blog/ directory. The file name should follow the format YYYY-MM-DD-title.md.
Example post structure:
---
title: "Title of the post"
date: 2024-01-15
author: codesandtags
categories: ["category1", "category2"]
tags: ["tag1", "tag2"]
draft: false
---
Content of your post goes here...title(required): The post titledate(required): Publication date (YYYY-MM-DD format)author(optional): Author name (defaults to "codesandtags")categories(optional): Array of category namestags(optional): Array of tag namesimage(optional): Path to featured imagedraft(optional): Set totrueto hide from production
npm run dev- Start development servernpm run build- Build for production (includes Pagefind search index)npm run preview- Preview production build locallynpm run migrate:posts- Run post migration script
Build the site:
npm run buildThe output will be in the dist/ directory, ready to deploy to GitHub Pages or any static hosting service.
- Astro - Static site framework
- Tailwind CSS - Utility-first CSS framework
- Pagefind - Static search library
- MDX - Markdown with JSX components
- TypeScript - Type safety
- GitHub Pages - Hosting
blog/
βββ src/
β βββ components/ # Reusable Astro components
β βββ content/ # Blog posts (Markdown/MDX)
β βββ layouts/ # Page layouts
β βββ pages/ # Route pages
β βββ utils/ # Utility functions
βββ public/ # Static assets
βββ scripts/ # Migration and utility scripts
See LICENSE file for details.