Use the following command to install nodejs.
sudo pacman -S nodejs npm
Use the following command to show the version of nodejs.
Use the following command to show the version of npm.
Use the following command to install cnpm by npm. (If your region is CHINA)
Root account is recommended.
sudo npm install -g cnpm --registry=https://registry.npm.taobao.org
Use the following command to show the version of cnpm.
Install hexo-cli by cnpm command.
cnpm install -g hexo-cli
Create a folder and your will write your blog in the folder.
Now, we must initialize the blog folder, you can use the following command.
MUST USE ROOT ACCOUNT !
sudo hexo init
After run the command, we will get some folder and file (include hide file) automatic generation.
Use the following command to start up local blog, and you can access ‘localhost:4000’ to view the website by brower.
In this command, ‘s’ represents ‘server’. (Start the server)
Firstly, you should change your path to the blog folder.
Secondly, use the following command to create a new markdown file.
hexo n mdfilename
In this command, ‘n’ represents ‘new’. (Create a new post)
This markdown file can be found in source under your blog folder.
hexo clean to clean up the blog.
Use the following command to generate blog website.
In this command, ‘g’ represents ‘generate’. (Genrate static file)
Before this step, you must have a github account.
This step details will not be repeated here.
I think mostly people can sign up a github account.
If you can’t do that, I recommend to give up.(Are you kidding me?)
Create a new repository named
NOTICE: Please verify your account name is same to
Then you will get new repository named that.
Use the following command to install it.
cnpm install --save hexo-deployer-git
This command details will not be repeated here.
After all step, and make sure your configuration file is correct, you can execute the following command to deploy your blog to github page.
In this command, ‘d’ represents ‘deploy’. (Deploy your website)
During this time, your should enter your github account and corresponding password.
- 1. Hexo Blog Framework