These instructions are for AI assistants working in this project.
Always open @/openspec/AGENTS.md when the request:
- Mentions planning or proposals (words like proposal, spec, change, plan)
- Introduces new capabilities, breaking changes, architecture shifts, or big performance/security work
- Sounds ambiguous and you need the authoritative spec before coding
Use @/openspec/AGENTS.md to learn:
- How to create and apply change proposals
- Spec format and conventions
- Project structure and guidelines
Keep this managed block so 'openspec update' can refresh the instructions.
This is a Hugo-based static blog system using PaperMod theme, deployed on GitHub Pages. The system features multilingual support (Chinese/English), AI-powered content tools, and automated workflows.
- Hugo Version: 0.152.2 (extended)
- Theme: PaperMod (standard multi-page architecture)
- Languages: Chinese (default), English
- Deployment: GitHub Pages via GitHub Actions
- Content Structure: Multi-language content under
content/zh/andcontent/en/
hobbytp.github.io/
├── config/_default/ # Hugo configuration files
├── content/ # Multilingual content
│ ├── zh/ # Chinese content
│ └── en/ # English content
├── static/ # Static assets (images, CSS, JS)
├── layouts/ # Hugo template overrides
├── assets/ # SCSS/CSS processing
├── tools/ # Python tools for content management
│ ├── content-analysis/ # AI-powered content analysis
│ ├── image-optimization/ # Image optimization tools
│ ├── performance-monitor/ # Performance analysis
│ └── pdf-exporter/ # PDF export functionality
├── scripts/ # Automation scripts
├── .github/workflows/ # CI/CD workflows
└── public/ # Generated site (gitignored)
- BaseURL:
https://hobbytp.github.io/ - Title: "Peng Tan's AI Blog"
- Theme: PaperMod
- Default Language: Chinese (
zh) - Build Settings: Production-ready with optimizations enabled
- Multilingual Support: Separate content trees per language
- Image Optimization: WebP support, quality settings
- Performance Caching: Resource caching strategies
- SEO: Robots.txt enabled, Git info disabled
# Start development server
make dev
# or
docker-compose up hugoThe development server runs on http://localhost:1313 with:
- Live reload enabled
- Draft content visible
- Fast rendering disabled for better debugging
# Production build
make build
# or
make full-build # Includes optimization and analysis
make full-build-ai # AI-enhanced build process# Run complete architecture validation
make validate-architectureThe validation script checks:
- Template architecture compliance (PaperMod standard)
- CSS file size limits (≤1000 lines)
- No problematic CSS selectors
- Hugo build success
- SPA mode disabled status
# Basic content analysis
make analyze-content
# AI-enhanced content analysis
make analyze-content-ai
# Analyze specific file
make analyze-content FILE=./content/zh/some-article.md# Performance monitoring
make analyze-performance
make performance-report- Trigger: Push to
mainorgh-pagesbranches - Process: Build → Deploy to GitHub Pages
- Environment: Production Hugo build with minification
- Dependencies: Node.js for PostCSS processing
- Checkout repository with submodules
- Setup Hugo v0.152.2 extended
- Install Node.js dependencies (PostCSS, Autoprefixer)
- Build site with
hugo --minify --configDir=config - Deploy to GitHub Pages
- Main File:
assets/css/custom.css(~745 lines) - Pipeline: Hugo CSS bundling with minification and fingerprinting
- Limits: Keep under 1000 lines for performance
- Approach: Override PaperMod CSS variables, avoid CDN dependencies
- Location:
layouts/directory - Standard: Follow Hugo template hierarchy
- Compliance: Must be PaperMod compatible
- Forbidden: No SPA templates or complex JavaScript routing
- Basic: Word count, reading time, structure analysis
- AI-Enhanced: Content quality scoring, SEO recommendations
- Dashboard: JSON data generation for frontend analytics
# Optimize existing images
make optimize-images
# Generate AI cover images
make generate-ai-covers
# Generate covers for specific directory
make generate-covers-for-directory DIRECTORY=papers# Export all articles to PDF
make export-pdf
# Export specific article
make export-pdf FILE=./content/zh/article.mdmake dev- Start development servermake fresh- Clean and restartmake stop- Stop services
make build- Production buildmake full-build- Complete build processmake clean- Clean build artifacts
make analyze-content- Content quality analysismake analyze-performance- Performance monitoringmake optimize-images- Image optimization
make analyze-content-ai- AI-enhanced analysismake generate-ai-covers- AI cover generationmake generate-json-data-ai- AI analytics data
- Standard Hugo template hierarchy
- PaperMod theme customization
- CSS custom properties for theming
- Hugo's built-in features and optimizations
- Progressive enhancement JavaScript
- SPA mode activation (templates preserved but disabled)
- External CSS frameworks via CDN
- Complex JavaScript routing systems
- Modifying core PaperMod templates unnecessarily
- CSS
:contains()selectors assets/css/custom.css> 1000 lines
- Hugo: v0.152.2+ extended
- Docker: For containerized development
- Python: For AI tools (conda
news_collectorenvironment) - Node.js: For PostCSS processing
Key variables in .env file:
VOLCENGINE_ACCESS_KEY,VOLCENGINE_SECRET_KEY- Default AI image generationMODELSCOPE_API_KEY- Alternative AI serviceOPENAI_API_KEY- OpenAI integrationTEXT2IMAGE_PROVIDER- AI service selection
- Run
make validate-architecture - Test with
make build - Check CSS file size limits
- Verify template compliance
- Use proper front matter with language tags
- Place content in correct language directory
- Test with
make analyze-content - Generate covers with AI tools when needed
- Optimize images before adding to content
- Use Hugo's built-in image processing
- Monitor with
make analyze-performance - Keep CSS bundle size minimal
- Architecture:
ARCHITECTURE.md- Detailed system architecture - Development:
CLAUDE.md- Development guidelines - Project:
README.md- General project information - Layouts:
docs/layout-overview.md- Template structure
Current Architecture Status: ✅ STABLE & PRODUCTION-READY Last Updated: Based on analysis of Hugo v0.152.2, PaperMod theme, and current tooling Maintainer: Follow the established patterns and validation procedures for any changes.