An open API service indexing awesome lists of open source software.

https://github.com/codesandtags/blog

πŸ“This is my personal blog and portfolio to connect my code, experiences and learnings with the world. 🌎β™₯️
https://github.com/codesandtags/blog

Last synced: 3 months ago
JSON representation

πŸ“This is my personal blog and portfolio to connect my code, experiences and learnings with the world. 🌎β™₯️

Awesome Lists containing this project

README

          

# Codes and Tags Blog

This is the repository for my personal blog, where I document technical stuff and knowledge that I want to share with the world.

## πŸš€ Getting Started

### Prerequisites

- Node.js 18+ and npm (or yarn/pnpm)

### Installation

1. Clone the repository:

```bash
git clone https://github.com/codesandtags/blog.git
cd blog
```

2. Install dependencies:

```bash
npm install
```

3. Start the development server:

```bash
npm run dev
```

The blog will be available at `http://localhost:4321`

## πŸ“ Adding a New Post

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:

```markdown
---
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...
```

### Post Frontmatter

- `title` (required): The post title
- `date` (required): Publication date (YYYY-MM-DD format)
- `author` (optional): Author name (defaults to "codesandtags")
- `categories` (optional): Array of category names
- `tags` (optional): Array of tag names
- `image` (optional): Path to featured image
- `draft` (optional): Set to `true` to hide from production

## πŸ› οΈ Available Scripts

- `npm run dev` - Start development server
- `npm run build` - Build for production (includes Pagefind search index)
- `npm run preview` - Preview production build locally
- `npm run migrate:posts` - Run post migration script

## πŸ—οΈ Build & Deploy

Build the site:

```bash
npm run build
```

The output will be in the `dist/` directory, ready to deploy to GitHub Pages or any static hosting service.

## 🎨 Tech Stack

- [Astro](https://astro.build/) - Static site framework
- [Tailwind CSS](https://tailwindcss.com/) - Utility-first CSS framework
- [Pagefind](https://pagefind.app/) - Static search library
- [MDX](https://mdxjs.com/) - Markdown with JSX components
- [TypeScript](https://www.typescriptlang.org/) - Type safety
- [GitHub Pages](https://pages.github.com/) - Hosting

## πŸ“ Project Structure

```
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
```

## πŸ“„ License

See [LICENSE](LICENSE) file for details.