A static site generator written in Rust, designed to be compatible with Hexo themes (EJS templates).
My blog is using Hexo, but I don't want to install Node.js and all the dependencies just to generate static files. So I wrote this project to generate Hexo sites using Rust.
This project was built entirely through vibe coding with AI!
Note: hexo-rs don't support all Hexo features, please read the "Limitations" section below.
- Fast: generates sites faster than the Node.js version of Hexo
- Compatible: Supports most Hexo EJS themes
- Simple: Command-line interface is basically consistent with Hexo
cargo install hexo-rsOr with cargo-binstall (faster, downloads prebuilt binary):
cargo binstall hexo-rs# Generate static files
hexo-rs generate
# Start local server
hexo-rs server
# Clean generated files
hexo-rs clean
# Create new post
hexo-rs new "Post Title"
# List posts
hexo-rs listhexo-rs does not include a built-in Stylus compiler. If the theme uses .styl files, you need to:
Option 1: Install stylus
npm install -g stylushexo-rs will try to call npx stylus to compile, but this requires a Node.js environment.
Option 2: Pre-compile CSS (Recommended)
# Generate once using Node.js version of Hexo
npx hexo generate
# Copy the compiled CSS to the theme directory
cp public/css/style.css themes/your-theme/source/css/style.cssMost EJS syntax is supported, but the following features may not be fully compatible:
- Complex JavaScript expressions (executed using QuickJS engine)
- Some helper functions provided by Hexo plugins
- Complex parameter passing in
<%- partial(...) %>
- Hexo plugin system
- Custom Generators
- Custom Helpers (only built-in helpers are supported)
- Deploy functionality (
hexo deploy) - Limited draft support
Uses pulldown-cmark to render Markdown, which may have subtle differences from Hexo's default marked or markdown-it:
- Code highlighting uses
syntect - Some Hexo tag plugin syntax is not supported
The order of configuration items in theme configuration files (_config.yml) is preserved, but some complex YAML structures may be parsed differently.
- vexo
- Before first use: It's recommended to generate once with the Node.js version of Hexo to ensure the theme's CSS is compiled
- Post Front Matter: Ensure the format is correct, recommended date format is
YYYY-MM-DD HH:mm:ss - File watching:
hexo-rs serverwill automatically watch for file changes and regenerate - Debug mode: Use
hexo-rs -d generateto view detailed logs
# Development build
cargo build
# Release build
cargo build --release
# Run tests
cargo test
# Code linting
cargo clippyMIT