Skip to content

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.

Terminal window
npm install -D @pageflare/cli

Chain pageflare after hexo generate in your npm scripts:

package.json
{
"scripts": {
"build": "hexo generate && pageflare public/ --in-place"
}
}

Or run directly:

Terminal window
hexo generate && pageflare public/ --in-place

Create a pageflare.jsonc in your project root:

pageflare.jsonc
{
"minify_html": true,
"minify_css": true,
"minify_js": true,
"js_defer": true,
"lazy_images": true,
"img_dimensions": true,
"font_swap": true,
"preconnect_hints": true
}

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:

pageflare.jsonc
{
"minify_html": false,
"minify_css": false,
"minify_js": false
}
.github/workflows/build.yml
- name: Build Hexo
run: npx hexo generate
- name: Optimize with pageflare
uses: getappz/pageflare-cli@v1
with:
args: "public/ --in-place"
netlify.toml
[build]
command = "hexo generate && pageflare public/ --in-place --no-progress"
publish = "public"
vercel.json
{
"buildCommand": "hexo generate && pageflare public/ --in-place --no-progress"
}

Hexo has npm-based plugins for optimization. After adding pageflare, you can remove:

Packagepageflare equivalent
hexo-html-minifierHTML minification
hexo-clean-cssCSS minification
hexo-uglifyJS minification
hexo-generator-sitemapSitemap generation via llm.sitemap config
hexo-lazyload-imageLazy loading with dimension inference

Set the PAGEFLARE_LICENSE environment variable to unlock Pro optimizations:

Terminal window
PAGEFLARE_LICENSE=your-key npm run build

Hexo static output works with any hosting provider:

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.