Hexo SEO Optimization (Search Engine Optimization)

Today let’s talk about hexo’s SEO, specifically some search engine optimization for Baidu and Google.

Sitemap

  1. Install sitemap plugin
npm install hexo-generator-sitemap --save
npm install hexo-generator-baidu-sitemap --save
  1. Add the following configuration in _config.yml
sitemap:
  path: sitemap.xml
baidusitemap:
  path: baidusitemap.xml
  1. Generate sitemap
hexo clean
hexo g

Baidu Active Push

  1. Install plugin
npm install hexo-baidu-url-submit --save
  1. Plugin configuration in _config.yml
baidu_url_submit:
  count: 10 # Number of latest links to submit
  host: time-friend.com # Domain registered on Baidu Webmaster Platform, although the official recommendation includes www, it can be without.
  token: your_token ## Note: this is your secret key, please don't publish it in public repositories!
  path: baidu_urls.txt # Text file address, new links will be saved in this text file
  1. Deploy configuration in _config.yml
deploy:
- type: git    # Deploy type
  repository: xxxxx  # Repository
  branch: master  
- type: baidu_url_submitter # Add this line
  1. Push and deploy
hexo clean
hexo g

Article Link:

/en/archive/hexo-seo-optimization/

# Related Articles