Hexo is a fast, Node.js-powered static site generator with a rich plugin ecosystem. In about ten minutes you can have a fully functional blog with RSS, search, sitemap, and multiple theme options — all served as static HTML with no server-side runtime.
Why Hexo The static site generator landscape is crowded — Jekyll, Hugo, Eleventy, Astro, and many others. Hexo’s strengths are:
Node.js native — no Ruby or Go installation required if you’re already a JS developer
EJS/Nunjucks/Pug templating — familiar for front-end developers
Hexo CLI — a hexo new "Post Title" command scaffolds a new post instantly
Plugin ecosystem — search, feeds, sitemaps, and more, all as npm packages
Fast enough — a few hundred posts generate in seconds
Setup Prerequisites You need Node.js 16+ and npm (or yarn/pnpm). Verify with:
1 2 node --version npm --version
Install Hexo CLI
Create a New Site 1 2 3 hexo init my-blogcd my-blog npm install
The resulting directory tree:
1 2 3 4 5 6 7 8 9 10 my-blog/ ├── _config.yml # Site configuration ├── package.json ├── scaffolds/ # Post/page/draft templates │ ├── post.md │ ├── page.md │ └── draft.md ├── source/ │ └── _posts/ # Your Markdown content └── themes/ # Theme directory
Core Concepts Front Matter Every post and page starts with YAML front matter:
1 2 3 4 5 6 7 8 9 --- title: My First Post date: 2025-01-20 10:00:00 categories: - Development tags: - hexo - guide ---
Creating Content 1 2 3 4 5 6 7 8 9 10 11 hexo new post "Building a Blog with Hexo" hexo new page about hexo new draft "Work in Progress" hexo publish "Work in Progress"
The <!-- more --> Tag Insert <!-- more --> anywhere in a post body to define the excerpt boundary. Everything before the tag appears on the index page:
1 2 3 4 5 This is the excerpt shown on the homepage. <!-- more --> This content is only visible on the full post page.
Configuration The root _config.yml controls site-wide settings:
1 2 3 4 5 6 7 8 9 10 11 12 title: My Blog subtitle: Writing about things I find interesting author: Your Name url: https://yourblog.com permalink: :year/:month/:day/:title/ theme: vaultex index_generator: per_page: 10 order_by: -date
Plugins These three plugins complement Vaultex:
1 npm install hexo-generator-search hexo-generator-feed hexo-generator-sitemap
Add to _config.yml:
1 2 3 4 5 6 7 8 9 10 11 12 search: path: search.xml field: post content: true feed: type: atom path: atom.xml limit: 20 sitemap: path: sitemap.xml
Development Server
The server starts at http://localhost:4000 and reloads on file changes (with a few seconds of latency for large sites).
Building for Production 1 2 3 4 hexo clean hexo generate hexo g
Output goes to public/. Deploy anywhere that serves static files: GitHub Pages, Netlify, Vercel, Cloudflare Pages, or your own nginx server.
Deployment Targets Hexo has built-in deployers for common targets:
Target
Plugin
GitHub Pages
hexo-deployer-git
Netlify
Native — just push to git
Vercel
Native — just push to git
FTP/SFTP
hexo-deployer-ftpsync
Rsync
hexo-deployer-rsync
For GitHub Pages:
1 npm install hexo-deployer-git
1 2 3 4 5 deploy: type: git repo: https://github.com/username/username.github.io branch: main
Next Steps Once your site is running:
Install and configure a theme (like Vaultex)
Create your About and Contact pages
Write your first real post
Set up a deployment pipeline (GitHub Actions works well)
Add your domain and configure DNS