Rav is a modern personal blog built with Next.js 16, featuring MDX content management, internationalization support, AI-powered translation, and interactive features.
- Framework: Next.js 16 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS 4
- Animation: Motion (Framer Motion)
- Content: MDX with Shiki syntax highlighting
- Internationalization: next-intl v4 (zh-CN, en)
- AI Integration:
- @ai-sdk/xai for chat
- @ai-sdk/google for automated translation
- Package Manager: pnpm 10.6.5+
- Code Quality: ESLint + Prettier
- Deployment: Docker support (standalone mode)
- π Next.js 16 App Router - Fully static site generation with
generateStaticParams() - π Enhanced MDX - Syntax highlighting (Shiki), auto-linked headings, GFM support
- π Bilingual Support - Chinese (default) and English with automatic translation
- π€ AI-Powered Translation - Automated zh-CN β en translation using Google Generative AI
- π¨ Modern Styling - Tailwind CSS 4 with custom design tokens
- β¨ Smooth Animations - Motion library with stagger effects
- π± Responsive Design - Mobile-first approach
- π SEO Optimized - Dynamic OG images, RSS feed, sitemap
- π³ Docker Ready - Standalone output mode for easy deployment
- π¦ SVG Optimization - Auto-generated React components from SVG assets
- Node.js 18+
- pnpm 10.6.5
- Docker (optional, for containerized deployment)
# Clone the repository git clone https://github.com/yikZero/Rav.git # Install dependencies pnpm install
# Start development server
pnpm devThe development server will start at http://localhost:11300.
# Build for production pnpm build # Start production server pnpm start
# Build Docker image docker build -t rav . # Run Docker container docker run -p 11300:11300 rav
rav/
βββ app/
β βββ [locale]/ # Localized routes (zh-CN, en)
β β βββ blog/ # Blog listing and posts
β β β βββ [slug]/ # Individual blog post pages
β β βββ talk/ # AI chat page
β β βββ page.tsx # Homepage
β βββ api/
β β βββ og/ # Open Graph image generation
β βββ rss.xml/ # RSS feed generation
βββ components/ # React components
β βββ icons/ # Auto-generated SVG components
β βββ ... # UI components
βββ content/ # MDX content
β βββ posts/
β β βββ zh-CN/ # Chinese posts (source)
β β βββ en/ # English posts (auto-translated)
β βββ changelogs/
β βββ projects/
βββ lib/ # Core utilities
β βββ mdx.utils.ts # MDX loading logic
β βββ post.utils.ts # Post metadata parsing
β βββ utils.ts # Helper functions
βββ scripts/ # Build and translation scripts
β βββ translate.ts # AI translation automation
β βββ utils/ # Translation utilities
βββ i18n/ # i18n configuration
βββ messages/ # Translation messages (UI)
β βββ zh-CN.json
β βββ en.json
βββ public/ # Static assets
βββ fonts/ # Custom fonts
βββ rav.config.ts # Site configuration
βββ next.config.ts # Next.js configuration
- ESLint for code linting
- Prettier for code formatting
- TypeScript strict mode
- Import sorting with @trivago/prettier-plugin-sort-imports
- Create a new MDX file in
content/posts/zh-CN/with frontmatter:
--- title: "Your Post Title" publishedAt: "2024εΉ΄01ζ01ζ₯" description: "Post description" image: "https://cdn.yikzero.com/your-image.jpg" category: "Tech" state: "published" ---
- Write your content in MDX format (supports GFM, code blocks, images, etc.)
Translate Chinese posts to English automatically using AI:
# Translate only changed files pnpm translate # Force translate all files (ignore cache) pnpm translate:force # Translate a specific file pnpm translate your-post-name
Requirements: Set GOOGLE_GENERATIVE_AI_API_KEY in your .env file.
How it works:
- Reads posts from
content/posts/zh-CN/ - Only processes posts with
state: published(skips drafts) - Uses file hash to detect changes (incremental translation)
- Generates English versions in
content/posts/en/ - Tracks translation state in
scripts/translate-state.json
# Generate optimized React components from SVG files in assets/
pnpm svgComponents will be created in components/icons/.