My Hexo setting notes
Just random stuff, may be outdated.
Prerequisites
Ubuntu
- We will need to have NPM and nodejs installed
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt install npm
- Install Hexo core components
npm install hexo-cli -g
npm install hexo-deployer-git --save
, so Hexo site deployment using git will work properly
Mac
- Use
homebrew
to installnpm
andnodejs
- Install Hexo core components
npm install hexo-cli -g
npm install hexo-deployer-git --save
, so Hexo site deployment using git will work properly
Hexo Usage
- Create a new project:
- run
hexo init __FOLDERNAME__
in the directory that you would like to save the Hexo project git init
the project folder. NOTICE: All files to be displayed must be on [gh-pages
](https://pages.github.com/- Setup
git remote
andgit branch
according to the official documentation!.deploy_git
is the place where the automatic git commits go
) (set this to default branch to avoid further problems)
- Setup
- Setup
_config.yml
properly (Notes are down below)
- run
- Create a new article:
hexo new "__ARTICLE_NAME__"
- The most useful deployment command is
hexo generate --deploy
- Some basic commands:1234hexo cleanhexo generatehexo deployhexo server
Notes for _config.yml
(top level one)
There are only a few parts to change when setting up a whole new project. The following examples are all taken from my currently working Hexo site.
Site
|
|
Project root
|
|
Themes
To replicate the theme that I am using, there are only three steps to do.
First, clone the next theme into themes
folder by running git clone https://github.com/iissnan/hexo-theme-next themes/next
.
Second, change the theme name in _config.yml
at project root. Notice that each theme has their own _config.yml
.
Third, go to the _config.yml
in themes/next/
, and look for Schemes
. I am currently using the Mist
scheme.
P.S. Special thanks to BeMg for helping me out on changing themes.
Deployment settings
|
|
Create special pages for next
theme
- Run
hexo new page "tags"
Go to
tags/index.md
and copy-paste the following content1234title: All tagsdate: 2016-08-09 01:47:00type: "tags"---Run
hexo new page categories
- Go to12345title: All Categoriesdate: 2017-05-01 09:45:00type: "categories"comments: false---
Google Analytics
Simply update the google_analytics
field in the theme’s _config.yml
Code highlight
highlight_theme: night eighties
Other settings
Check this out!