Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Generates sitemap.xml and sitemap.txt for Hexo static sites, with custom templates, tag/category options, and per-post exclusion.
hexo-generator-sitemap is a Hexo plugin that generates standard sitemaps in XML and plain-text formats for static sites built with the Hexo framework.
hexo-generator-sitemap is an open-source npm package maintained by the hexojs GitHub organization. It plugs directly into Hexo's build pipeline, reading your site's pages, posts, tags, and categories to produce sitemap.xml and sitemap.txt files in your public directory. The plugin is configured through a small block in _config.yml and requires no manual sitemap upkeep.
Install the plugin with npm install hexo-generator-sitemap --save, add a sitemap block to your _config.yml, and rebuild your site. The plugin hooks into Hexo's generation pipeline and writes the sitemap files to your public directory. Exclusions are handled by reading each post/page's front matter for a sitemap: false flag.
Run npm install hexo-generator-sitemap --save in your Hexo project directory. The plugin version should match your Hexo version: 2.x for Hexo 4, 1.x for Hexo 3, and 0.x for Hexo 2.
Yes. The path option accepts an array of paths, so you can set path to both sitemap.xml and sitemap.txt to output both formats, or provide any other file names you need.
Add sitemap: false to the post's front matter. For example, set title, date, and sitemap: false in the YAML block. The plugin will skip that post when generating the sitemap.
Yes. Set tags: true and categories: true in the sitemap config block to include your site's tag and category pages. Both options are off by default.
Yes. It is an open-source plugin distributed via npm, so you can install and use it at no cost.
