Hexo
Hexo is a fast, simple blog framework powered by Node.js. It outputs a fully static site to public/ by default. pageflare integrates as a post-build step via npm scripts.
Install
Section titled “Install”npm install -D @pageflare/cliChain pageflare after hexo generate in your npm scripts:
{ "scripts": { "build": "hexo generate && pageflare public/ --in-place" }}Or run directly:
hexo generate && pageflare public/ --in-placeConfiguration
Section titled “Configuration”Create a pageflare.jsonc in your project root:
{ "minify_html": true, "minify_css": true, "minify_js": true, "js_defer": true, "lazy_images": true, "img_dimensions": true, "font_swap": true, "preconnect_hints": true}What pageflare Adds
Section titled “What pageflare Adds”Hexo has optional minification plugins (hexo-html-minifier, hexo-clean-css), but they only cover basic minification. pageflare adds:
- HTML, CSS, and JS minification
- Lazy loading and image dimension inference
- JavaScript defer and loader injection
- Font display swap and self-hosting
- Preconnect hints for third-party origins
- Critical CSS extraction (Pro)
- Responsive image srcset generation (Pro)
If you already use Hexo minification plugins, you can disable pageflare’s minification and keep the other optimizations:
{ "minify_html": false, "minify_css": false, "minify_js": false}CI/CD Integration
Section titled “CI/CD Integration”GitHub Actions
Section titled “GitHub Actions”- name: Build Hexo run: npx hexo generate
- name: Optimize with pageflare uses: getappz/pageflare-cli@v1 with: args: "public/ --in-place"Netlify
Section titled “Netlify”[build] command = "hexo generate && pageflare public/ --in-place --no-progress" publish = "public"Vercel
Section titled “Vercel”{ "buildCommand": "hexo generate && pageflare public/ --in-place --no-progress"}Replacing plugins
Section titled “Replacing plugins”Hexo has npm-based plugins for optimization. After adding pageflare, you can remove:
| Package | pageflare equivalent |
|---|---|
hexo-html-minifier | HTML minification |
hexo-clean-css | CSS minification |
hexo-uglify | JS minification |
hexo-generator-sitemap | Sitemap generation via llm.sitemap config |
hexo-lazyload-image | Lazy loading with dimension inference |
Pro License
Section titled “Pro License”Set the PAGEFLARE_LICENSE environment variable to unlock Pro optimizations:
PAGEFLARE_LICENSE=your-key npm run buildDeploying
Section titled “Deploying”Hexo static output works with any hosting provider:
- Vercel — automatic Vercel Image Optimization
- Netlify — automatic Netlify Image CDN
- Cloudflare Pages — Cloudflare Image Resizing
- Self-hosted — any static file server
Troubleshooting
Section titled “Troubleshooting”pageflare processes 0 files
Verify Hexo finished generating — use hexo generate (not hexo server). The output directory is public/ by default, configurable via public_dir in _config.yml.
Theme assets not optimized
Make sure theme assets are copied to public/ during generation. Some themes use CDN-hosted assets that pageflare cannot process locally.
Slow builds on large blogs
For blogs with thousands of posts, run with --log info to see per-phase timing. Use --force in CI to skip incremental caching.