Astro Blog is an out-of-the-box (OOTB), easy-to-use, and lightweight blogging platform built for speed and SEO. This blog is:
- Optimized for performance to rank well on search engines
- Responsive – looks great on desktops, tablets, and mobile
- Easy to customize – modify content, layout, and styles with minimal effort
- Docker-ready – simple deployment with Docker Compose
✔ Homepage – Showcase your blog content ✔ Category Pages – Organize posts by topics ✔ Blog Post Pages – Readable markdown-based posts ✔ Mobile-Friendly – Responsive layout
| Technology | Why We Use It |
|---|---|
| Astro 🪐 | Lightning-fast static site generator optimized for SEO. |
| Tailwind CSS 🎨 | Utility-first CSS framework for rapid styling and responsiveness. |
| Markdown ✍️ | Simple, database-free blogging format. |
| Docker Compose 🐳 | Easily containerize and run the project in any environment. |
Follow these steps to get started:
Clone Repository:
Clone this projectSet up Mailchimp account:
Set up .env file:
- Copy
.env-exampleinto.envin the root directory - Fill contents of
.env
Run the Blog with Docker Compose:
docker-compose up --build3️⃣ Access the Blog:
- Open http://localhost:3000 in your browser 🎉
my-astro-blog/
├── public/ # Static assets (images, icons, etc.)
│ └── images/
| └── category # Category folder(s)
| └── article # Article image(s)
├── src/
│ ├── components/ # Reusable UI components (Header, Footer, Sidebar)
│ ├── layouts/ # Page layouts (Main, Blog)
│ ├── pages/ # Pages (index, category, blog posts)
| └── category # Category folder(s)
| └── article # Article(s) on parent category
│ ├── styles/ # CSS files (global.css, home.css, etc.)
├── .env # Environment Variables (Mailchimp)
├── Dockerfile # Docker setup
├── docker-compose.yml # Docker Compose configuration
├── package.json # Project dependencies & scripts
├── tailwind.config.js # Tailwind CSS configuration
├── astro.config.mjs # Astro config
├── robots.txt # SEO - URLs to crawl, URLs to avoid
├── sitemap.xml # SEO - See below link. Fill out. Upload to Google
└── README.md # Project documentation
- Fill out
sitemapand submit to Google - Fill out
robots.txt- by default you want to avoid category pages (noindex) - they're strictly for the user experience. Why Robots.txt - Ensure Home page has properly defined Meta information
- Ensure each article has properly defined Meta information
- Ensure images are compressed (less is more) or via CDN with proper alt tag. View image [SEO best practices].
Right now, the blog is in development mode. To deploy it in production, follow these key steps:
Modify the command in docker-compose.yml:
services:
astro:
build: .
ports:
- "3000:3000"
environment:
- NODE_ENV=production
command: npm run build && npm run start