Configure Hexo

Updated 14/09/2025

Sweet plugins and configuration settings for Hexo.

hexo-deployer-git

yarn add hexo-deployer-git

Once installed add the following to the root _config.yml

1
2
3
4
5
6
7
8
# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
type: git
repo: https://github.com/carlpaton/carlpaton.github.io.git
branch: master
name: carlpaton
email: carl.paton@gmail.com

This then works with the commands:

  • hexo generate (short hand hexo g)
  • hexo deploy (short hand hexo d)

hexo-browsersync

yarn add hexo-browsersync

This then works with the command hexo serve (short hand hexo s)

Google Analytics

Then go to your theme’s main _config.yml and look for a property called google_analytics. Fill in your tracking ID.

google_analytics: UA-0000000-0

npm install hexo-generator-search

SEO Tools

Install tools hexo-generator-sitemap and hexo-generator-robotstxt

1
npm install hexo-generator-sitemap hexo-generator-robotstxt --save

Then configure in _config.yml (root Hexo config, not theme) with

1
2
sitemap:
path: sitemap.xml

and

1
2
3
4
5
robotstxt:
useragent: "*"
allow:
- /
sitemap: /sitemap.xml

Now run hexo generate, you can run hexo clean but be careful as this will delete anything you have manually added to the public folder.