A modern, responsive blog theme for Astro with support for tags, categories, and series. This theme is designed to be fast, SEO-friendly, and easy to customize.
- 🚀 Built with Astro - Benefit from Astro's speed and flexibility
- 📱 Fully Responsive - Looks great on all devices
- 🎨 Customizable - Easy to adapt to your brand
- 🔍 SEO Optimized - Meta tags, Open Graph, and JSON-LD
- 📝 Blog Ready - Support for posts, categories, tags, and series
- 🔎 Search Functionality - Client-side search with Fuse.js
- 📊 Pagination - For blog posts, categories, tags, and authors
- 📰 RSS Feed - Automatically generated RSS feed
- 🗺️ Sitemap - Automatically generated sitemap
- 🖋️ MDX Support - Use components in your markdown
- 🔤 Typography - Beautiful typography with Tailwind CSS
- 🌙 Icons - Easy icon usage with Astro Icon
- 💡 FOUC Prevention - Inline scripts to minimize flash of unstyled content and theme inconsistencies on load.
├── public/ # Static assets
├── src/
│ ├── assets/ # Images and other assets
│ ├── config/ # Site configuration
│ ├── content/ # Content collections (blog posts, authors, etc.)
│ ├── layouts/ # Layout components
│ ├── pages/ # Page components and routes
│ ├── styles/ # Global styles
│ └── utils/ # Utility functions
├── astro.config.mjs # Astro configuration
├── package.json # Dependencies and scripts
- src/config/: Contains configuration files for the site, menus, and social links
- src/content/: Contains all content collections (blog posts, authors, pages)
- src/layouts/: Contains layout components used throughout the site
- src/pages/: Contains all page components and defines the routing structure
The theme includes several reusable components:
- Layout.astro: Main layout component with header and footer
- PostLayout.astro: Layout for blog posts with metadata and content
- Header/Footer: Navigation and site information
- Pagination: For navigating through multiple pages of content
- Search: Client-side search functionality
- Author Card: Display author information
- Post Card: Display post previews in lists
- Tag/Category Cloud: Display and filter by tags or categories
- Node.js 22.12.0 or newer
- npm 10.8.2 or newer
-
Clone this repository:
git clone git@github.com:bitdoze/bitdoze-astro-theme.git my-blog cd my-blog -
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Open your browser and visit
http://localhost:4321
Tailor the theme to your needs by updating the following configuration files:
- Site URL:
- Set the
SITE_URLenvironment variable in production. It falls back tohttps://www.bitdoze.comfor local builds.
- Set the
- Primary Site Metadata & Settings:
- Update
src/config/site.tsfor essential site details such as:title: The main title of your site.description: A brief description for SEO and metadata.author: Default author name.brandName,logo, and logo dimensions.- Hero and footer descriptions.
ogImage: Path to your default OpenGraph image.postsPerPage: Number of posts to display on paginated pages.
- Update
- Menus:
- Modify
src/config/menu.jsonto define navigation links for the header and footer.
- Modify
- Social Media Links:
- Update
src/config/social.jsonwith your social media profile URLs.
- Update
- Contact Configuration (
src/config/config.json):- Set
params.contact_form_actionto your form endpoint. - Add only the public address, email, and phone details you want displayed.
- Set
Create a new .md or .mdx file in src/content/posts/ with the following frontmatter:
---
title: "Your Post Title"
meta_title: "SEO Title (optional)"
description: "Post description for SEO"
date: 2023-06-01
image: "../../assets/images/your-image.jpg"
authors: ["author-id"]
categories: ["category-name"]
tags: ["tag1", "tag2"]
series:
name: "Series Name"
position: 1
slug: "optional/custom-path"
canonical: "https://example.com/original-article/"
draft: false
---
Your post content goes here...Create a new .md file in src/content/authors/ with the following frontmatter:
---
title: "Author Name"
meta_title: "Author Name - Astro Blog Theme"
image: "../../assets/images/authors/author-image.jpg"
description: "Author description"
social:
facebook: "https://facebook.com/username"
twitter: "https://twitter.com/username"
website: "https://example.com"
---
Author bio goes here...This theme uses Tailwind CSS v4 for styling, which emphasizes a CSS-first, minimal-configuration approach.
Key Styling Files:
-
src/styles/global.css: This is the central file for Tailwind CSS setup and custom styles.- Tailwind's core styles (base, components, utilities) are imported via
@import "tailwindcss";. - The
@tailwindcss/typographyplugin is included using@plugin "@tailwindcss/typography";. - You can customize the theme by modifying the CSS variables defined in this file, which control colors, fonts, and other aspects.
- You can also add your own custom CSS rules here.
- Tailwind's core styles (base, components, utilities) are imported via
-
astro.config.mjs: The@tailwindcss/viteplugin is integrated here, but typically requires no direct configuration for v4 unless you have very specific needs.
Advanced Customization (Optional):
While most styling can be managed through src/styles/global.css, if you need to make advanced Tailwind customizations (e.g., adding complex custom themes, other specific Tailwind plugins that require JS configuration, or modifying Tailwind's default settings extensively), you can create a tailwind.config.js file in the project root. The @tailwindcss/vite plugin should automatically detect and use this file. Refer to the official Tailwind CSS documentation for details on tailwind.config.js options.
Create a new .astro file in the src/pages/ directory. The file path will determine the URL.
Build your site for production:
npm run buildRun the complete local verification suite:
npm run verifyThis runs Astro type checking, unit tests, and the production build. Draft and future-dated posts are excluded from routes, search, RSS, series navigation, and homepage widgets.
The built site will be in the dist/ directory, ready to be deployed to your favorite hosting platform.
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Astro
- Styled with Tailwind CSS
- Icons from Astro Icon
- Search functionality with Fuse.js