How naturelr/blog works
Project Type and Purpose
• This is a *static website* project combining:
• A Hexo‐based blog (Next theme)
• A docsify‐powered documentation site
• It uses Node.js and Docker locally and in CI for build, then publishes generated HTML to one or more GitHub Pages repos under custom domains (blog.naturelr.cc, docs.naturelr.cc).
Main Components
• Developer Workstation
• Local Node.js + Hexo‐CLI (via global npm)
• Optional Docker container (via Dockerfile, .dockerignore)
• Local source content (source/), theme, configs (_config.yml, _config.next.yml, _admin-config.yml)
• Source Repository
• Content directory (source/) with posts, drafts, configs, styles
• Build scripts (Makefile, deploy.sh)
• CI config (.github/workflows/*.yaml)
• CI/CD Pipeline (GitHub Actions)
• build-env-image: builds the Docker image used in CI
• build-image: builds an image with Node.js, Hexo, docsify setup
• deploy: runs hexo generate, docsify build (if applicable), pushes public/ to target Pages repo
• Static Site Generator
• Hexo + Next theme transforms Markdown in source/_posts, source/_drafts into HTML/CSS/JS
• docsify serves source/ as a dynamic docs site
• Hosting & Delivery
• GitHub Pages repos (blog and docs)
• Custom domains via CNAME files and DNS
• CDN (GitHub Pages) for global static delivery
• External Services
• npm registry (for theme and plugin installs)
• (Optional) Docker Hub or GitHub Packages for container images
Relationships & Data Flows
• Developer edits Markdown → commits to GitHub
• Git push triggers GitHub Actions workflow
• Actions pull code, build Docker image, install npm deps
• Inside container: run hexo generate → outputs public/; run docsify build → outputs docs directory
• Deploy step pushes static output to GitHub Pages branch
• DNS routes requests for blog.naturelr.cc / docs.naturelr.cc → GitHub Pages servers → end users
Architectural Patterns & Principles
• Separation of Concerns: content, theme/config, build pipeline, hosting
• Immutable Builds: Docker images ensure consistent build environment
• CI/CD: all builds and deploys automated via GitHub Actions
• Static Site Delivery: no runtime backend—pure HTML/CSS/JS served via CDN
• Extensibility Points: Hexo plugins, Next theme customizations, docsify config