hexo build personal blog tutorial
What is 1.hexo
Hexo efficient static site generation framework, based on her Node.js. By Hexo you can easily use Markdown to write the article, in addition to the Markdown syntax itself, can also be used to provide content Hexo label plug-in to quickly insert specific form, but also in relation to other frameworks, Hexo in speed is also a great advantage .
2. Install node.js
We understand Hexo Node.js, then we first need to build a blog site installation based on Node.js environment. Node.js is a JavaScript runtime environment Chrome V8 engine, you can be in a non-browser environment, explain to run JS code.
Download: http://nodejs.cn/download
Test the installation: the command line using the node -v, npm -v, view displays the version number that is success.
Now we need to replace the mirror npm
npm get registry
npm config set registry http://registry.npm.taobao.org/
3. Install Hexo
Hexo station is a tool that can help us to quickly generate basic blog file, install it needs to use the following command in the console:
npm install hexo-cli -g
After the installation is complete, you can check the version
hexo –v
Appears to explain the installation of FIG.
4. New Site
Create a new site
hexo init myblog
After the completion of the new cd myblog enter the directory install dependencies
npm install
After all rely fully installed you can compile the code, start the service
hexo g
hexo s
Start Service
Address bar: HTTP: // localhost: 4000 you can see the effect
5. Deploy site on github
First install git, installed classmates skip
git official website: https://git-scm.com/download
Can be selected according to their own system download
After the installation is complete, this option appears in the desktop right-click on the installation was successful
Create a log in to your github repository
The ssh address copied hexo profile
Set up SSH keys
Set your email address
ssh-keygen -t rsa -C "yourmail"
Then in C: \ there under Users \ Administrator path .ssh file folder open you can see just generated secret key information
Click to add ssh key is done add the ssh key
Finally, to detect what
ssh -T [email protected]
The following can be deployed
Generate static pages
hexo generate 或者 hexo g
deploy
hexo deploy 或者 hexo d
Then enter our github address https://chenylz.github.io you can see the effect it