This guide walks you through building a complete blog from scratch with astro-minimax.
Overview
flowchart LR
A[Create Blog] --> B[Configure Site]
B --> C[Deploy to Cloudflare]
C --> D[Setup Comments]
D --> E[Setup Analytics]
E --> F[Setup Notifications]
F --> G[Setup AI Chat]
G --> H[Complete]
style A fill:#22c55e,color:#fff
style H fill:#3b82f6,color:#fff
Estimated time: 45-60 minutes
Prerequisites
Before starting, ensure you have these accounts:
| Account | Purpose | Sign up |
|---|---|---|
| GitHub | Code hosting | github.com |
| Cloudflare | Blog deployment | cloudflare.com |
| Vercel | Comments and analytics | vercel.com |
Database uses Vercel’s built-in Neon PostgreSQL, no additional registration needed.
Part 1: Create Blog
Step 1.1: Use CLI to Create Project
Open terminal and run:
npx @astro-minimax/cli init my-blog
cd my-blog
pnpm installbashStep 1.2: Local Preview
pnpm run devbashVisit http://localhost:4321 to preview.
Step 1.3: Push to GitHub
git init
git add .
git commit -m "Initial commit"
gh repo create my-blog --private --source=. --pushbashTip
If you don’t have gh CLI, create a repo on GitHub and push manually.
Part 2: Configure Site
Step 2.1: Edit src/config.ts
export const SITE = {
website: "https://your-domain.com/", // Your domain
author: "Your Name", // Your name
title: "My Blog", // Blog title
desc: "A personal tech blog", // Blog description
lang: "en",
timezone: "America/New_York",
features: {
tags: true,
categories: true,
search: true,
darkMode: true,
ai: true, // Enable AI chat
waline: true, // Enable comments
sponsor: true, // Enable sponsor
},
// Other config...
};typescriptStep 2.2: Add First Post
Create src/data/blog/en/my-first-post.md:
---
title: My First Post
pubDatetime: 2026-03-18T10:00:00Z
author: Your Name
description: This is my first blog post.
tags:
- getting-started
category: General
---
Post content goes here...yamlPart 3: Deploy to Cloudflare Pages
Step 3.1: Create Project
- Login to Cloudflare Dashboard
- Click Workers & Pages → Create → Pages → Connect to Git
- Select your GitHub repository
Step 3.2: Configure Build Settings
| Setting | Value |
|---|---|
| Framework preset | Astro |
| Build command | pnpm run build |
| Build output directory | apps/blog/dist |
Step 3.3: Set Environment Variables
In Settings → Environment variables, add:
| Variable | Value |
|---|---|
NODE_VERSION | 22 |
Step 3.4: Wait for Deployment
Click Save and Deploy and wait for build to complete. You’ll get a .pages.dev domain.
Note
For details, see Deployment Guide and Environment Variables.
Part 4: Setup Comments
Waline is a lightweight comment system deployed on Vercel with Neon PostgreSQL database.
Step 4.1: Deploy Waline to Vercel
- Click one-click deploy: Waline Vercel Deploy
- Enter project name and click Create
- Wait for deployment (may fail initially due to missing database, this is normal)
Step 4.2: Create Neon PostgreSQL Database
- Go to Waline project in Vercel Dashboard
- Click Storage → Create Database
- Select Neon PostgreSQL
- Configure database (defaults work fine) and click Create
DATABASE_URLenvironment variable is auto-injected
Step 4.3: Initialize Database
- Click the created database in Vercel Storage
- Click Query tab
- Copy content from waline.pgsql
- Paste and click Run Query
Step 4.4: Configure Environment Variables and Redeploy
- Go to Settings → Environment Variables
- Confirm
DATABASE_URLexists (auto-injected) - Add these variables:
| Variable | Value |
|---|---|
PG_SSL | true |
SITE_URL | https://your-blog.pages.dev |
- Go to Deployments → Redeploy
Step 4.5: Update Blog Config
// src/config.ts
waline: {
enabled: true,
serverURL: "https://your-waline.vercel.app/",
lang: "en-US",
pageview: true,
reaction: true,
requiredMeta: ["nick", "mail"],
},typescriptTip
See Waline Setup Guide for complete instructions.
Part 5: Setup Analytics
Umami is a privacy-friendly web analytics tool, deployed for free on Vercel + Neon.
Step 5.1: Fork and Deploy Umami
- Fork Umami repository
- Import the forked repo in Vercel
- Select Next.js framework and click Deploy (may fail initially, normal)
Step 5.2: Create Neon Database
- Go to Umami project → Storage → Create Database
- Select Neon PostgreSQL, configure and create
DATABASE_URLis auto-injected to environment variables
Step 5.3: Redeploy
- Go to Deployments → Redeploy
- Wait for deployment to complete
Step 5.4: Get Website ID
- Visit your Umami instance
- First login (default: admin/umami), change password immediately
- Add website → Enter domain
- Copy Website ID
Step 5.5: Update Blog Config
// src/config.ts
umami: {
enabled: true,
websiteId: "your-website-id",
src: "https://your-umami-domain/script.js",
},typescriptTip
See Umami Setup Guide for complete instructions.
Part 6: Setup Notifications
Receive Telegram notifications when comments are posted or AI chats occur.
Step 6.1: Create Telegram Bot
- Search
@BotFatherin Telegram - Send
/newbot - Follow prompts to set bot name
- Get Bot Token (format:
123456789:ABCdef...)
Step 6.2: Get Chat ID
- Search
@userinfobotin Telegram - Send
/start - Get your Chat ID (numeric)
Step 6.3: Configure Cloudflare Environment Variables
Add in Cloudflare Dashboard:
| Variable | Value |
|---|---|
NOTIFY_TELEGRAM_BOT_TOKEN | Your Bot Token |
NOTIFY_TELEGRAM_CHAT_ID | Your Chat ID |
Tip
See Notification Guide for complete instructions.
Part 7: Setup AI Chat
astro-minimax has built-in AI chat assistant powered by Cloudflare Workers AI.
Step 7.1: Enable AI Feature
// src/config.ts
features: {
ai: true,
},
ai: {
enabled: true,
mockMode: false,
apiEndpoint: "/api/chat",
},typescriptStep 7.2: Build AI Data
pnpm run ai:process # Generate post summaries
pnpm run profile:build # Build author profilebashStep 7.3: Verify AI Binding
The project already includes wrangler.toml:
[ai]
binding = "minimaxAI"tomlCloudflare Pages automatically detects and enables Workers AI.
Tip
See AI Configuration Guide for complete instructions.
Part 8: Environment Variables Summary
Add all required environment variables in Cloudflare Dashboard:
Path: Workers & Pages → [your-project] → Settings → Environment variables
| Variable | Value | Purpose |
|---|---|---|
NODE_VERSION | 22 | Build environment |
NOTIFY_TELEGRAM_BOT_TOKEN | 123456:ABC... | Telegram notifications |
NOTIFY_TELEGRAM_CHAT_ID | 123456789 | Telegram notifications |
SITE_URL | https://your-blog.com | Site URL |
SITE_AUTHOR | Your Name | Author name |
Redeploy after adding variables.
Tip
See Environment Variables Guide for complete instructions.
Part 9: Verification Checklist
After deployment, verify these features:
- Blog accessible
- Custom domain configured (optional)
- Search working
- Comments working
- Analytics collecting data
- Telegram notifications received
- AI chat responding
- RSS feed valid
- OG images displaying
Troubleshooting
Deployment Failed
- Check build logs for errors
- Confirm
NODE_VERSION=22is set - Check
pnpm-lock.yamlis up to date
Comments Not Showing
- Check Waline
serverURLconfiguration - Check
PG_SSLenvironment variable is set totrue - Confirm database schema is initialized
- Check browser console for errors
AI Not Responding
- Check AI feature is enabled (
ai.enabled: true) - Check AI binding in
wrangler.toml - Run
pnpm run ai:processto generate data
Notifications Not Sending
- Check Telegram Bot Token and Chat ID
- Try sending a message to the bot first
- Check Cloudflare environment variables
Next Steps
- Add Posts — Learn post format and frontmatter
- Theme Configuration — Customize theme styles
- CLI Commands — Master common commands
- Feature Overview — Explore more features
评论区
文明评论,共建和谐社区