[Hexo] Use hexo-generator-baidu-sitemap plugin to generate Baidu sitemap.xml automatically in Hexo

hexo-generator-baidu-sitemap

Hexo is a fast, simple & powerful blog framework. It use plugins to provide features powerful APIs for limitless extensibility. Various plugins are available to support most template engines (EJS, Pug, Nunjucks, and many others). Easily integrate with existing NPM packages (Babel, PostCSS, Less/Sass, etc).

hexo-generator-baidu-sitemap plugin will generate Baidu sitemap.xml files for Hexo pages, posts, categories, tags.

Installation

Use npm to install hexo-generator-baidu-sitemap package.

1
2
3
$ npm install hexo-generator-baidu-sitemap --save

$ hexo clean

Configuration

It will generate baidusitemap.xml in the public folder by default after hexo-generator-baidu-sitemap installation.

You can configure this plugin in ./_config.yml.

1
2
baidusitemap:
path: baidusitemap.xml

The follow is the options:

  • path - Sitemap path. (Default: baidusitemap.xml)

Finally, you can visit <Your Site Url>/baidusitemap.xml in the browser, and check whether the baidusitemap.xml works correctly after Hexo restarted or regenerated.

References

[1] coneycode/hexo-generator-baidu-sitemap: Baidu Sitemap generator plugin for Hexo - https://github.com/coneycode/hexo-generator-baidu-sitemap

[2] Build and submit a sitemap  |  Google Search Central  |  Google Developers - https://developers.google.com/search/docs/advanced/sitemaps/build-sitemap

[3] Hexo - https://hexo.io/