Hexo Blog URL Submission to Baidu

Introduction

It is common to submit personal websites to search engines to be indexed. I have submitted my Hexo website to Google and Bing using the sitemap generated using hexo-generator-sitemap. However, when I submitted the same sitemap to Baidu, I encountered the following problem.

Baidu Sitemap Invalid Submission

After doing search, I think the error message was incorrect. Fundamentally, it was because the sitemap generated using hexo-generator-sitemap was not supported by Baidu.

In this blog post, I would like to quickly discuss how to submit Hexo website to Baidu.

Baidu Website Submission

Sitemap Submission

There was a Hexo module hexo-generator-baidu-sitemap which generates Hexo sitemap specifically for Baidu. However, this Hexo module has not been maintained for a while and did not seem to support Hexo 4. I personally tried it and it did not generate sitemap at all for my website.

URL Submission

In addition to sitemap submission, Baidu also allows URL submission. With the Hexo module hexo-baidu-url-submit, I was able to submit my Hexo website URLs to Baidu automatically.

Specifically, install Hexo module the at the Hexo website root directory.

1
$ npm install hexo-baidu-url-submit --save

In the _config.yml, change/add the following configurations for deployment.

_config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
deploy:
- type: git
repo: https://XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX@github.com/leimao/leimao.github.io
branch: master
message: "Hexo & Icarus Deployment Updated: {{ now('YYYY-MM-DD HH:mm:ss') }}"
ignore_hidden: false
- type: baidu_url_submitter # Baidu

baidu_url_submit:
count: 1000
host: https://leimao.github.io/ # Website URL submitted to Baidu
token: XXXXXXXXXXXXXXXX # Baidu URL submission token
path: baidu_urls.txt
Author

Lei Mao

Posted on

05-04-2022

Updated on

05-04-2022

Licensed under


Comments