My personal blog, built with Astro - a modern static site generator.
- Register divesh.gg domain
- Fast, static site generation with Astro
- Markdown content management with frontmatter
- Responsive design with dark mode support
- Tag-based navigation for blog posts
- Organized content collections for different types of posts
├── public/ # Static assets (images, fonts, etc.)
├── src/
│ ├── components/ # Reusable UI components
│ ├── content/ # Content collections
│ │ ├── waves/ # Stream of consciousness posts
│ │ └── depths/ # In-depth, longer-form content
│ ├── layouts/ # Page layout templates
│ │ ├── BaseLayout.astro # Main site layout
│ │ └── MarkdownPostLayout.astro # Blog post layout
│ ├── pages/ # Page routes and templates
│ │ ├── index.astro # Homepage
│ │ ├── waves/
│ │ │ └── [slug].astro # Dynamic route for waves posts
│ │ └── depths/
│ │ └── [slug].astro # Dynamic route for depths posts
│ ├── scripts/ # Client-side JavaScript
│ └── styles/ # Global CSS styles
│ └── content.config.ts # Content collection schema
└── package.json # Project dependencies and scripts
This blog uses a two-level layout system:
-
BaseLayout.astro - Provides the foundational HTML structure, including:
- HTML document structure
- Head metadata
- Header and footer components
- Global styling
-
MarkdownPostLayout.astro - Specialized layout for blog posts that:
- Builds upon BaseLayout
- Handles Markdown frontmatter data
- Formats post metadata (title, date, author, tags)
- Provides post-specific styling
This nested layout approach follows Astro's best practices for creating maintainable, reusable templates.
This blog uses Astro's Content Collections API to manage blog posts. These are organized into collections:
waves/- Stream of consciousness posts on various topicsdepths/- More in-depth, longer-form content
Each post is a Markdown file with frontmatter that follows this schema:
{
title: string,
description: string,
author: string,
pubDate: Date,
tags: string[],
image?: {
url: string,
alt: string
}
}All commands are run from the root of the project, from a terminal:
| Command | Action |
|---|---|
npm install |
Installs dependencies |
npm run dev |
Starts local dev server at localhost:4321 |
npm run build |
Build your production site to ./dist/ |
npm run preview |
Preview your build locally, before deploying |
npm run astro ... |
Run CLI commands like astro add, astro check |
npm run astro -- --help |
Get help using the Astro CLI |
- Create or edit Markdown files in the
src/content/directory - Run
npm run devto preview changes locally - Commit changes to the repository
- Deploy to your hosting platform of choice
[Add information about your deployment strategy here]