What is Hexo?
Hexo (official Chinese website) is a fast, concise and efficient blog framework. Make hundreds of pages instantly complete rendering within seconds. Hexo
supports Github Flavored Markdown
all the features, even Octopress
the most plug-ins that can be consolidated. and own a powerful plug-in system.
Installation
Hexo
is based node.js
, so we need to install the tool before installing it, npm
This tool is node.js
the tool to install the package, so we have to install first node.js
.
Install node. js
Operating system is ubuntu14.04
version above for example. You need to add node.js
the installation source to the local first.
1 $ curl-sl https://deb.nodesource.com/setup_6.x | sudo-e Bash-
Use the apt-get
installation nodejs
.
1 $ sudo apt-get install-y Nodejs
Installing NPM
Already installed nodejs
, install now npm
.
1 $ sudo apt-get install NPM
Installing Hexo
Now we use the npm
installation hexo
.
1 $ sudo npm install hexo-cli-g
Create a blog
Now that we have finished hexo
the installation, then let's create one now Blog
.
1. Create a site called blog
1 $ HEXO Init Blog
- If you do not write a blog, it will be initialized in the current directory. If a name is followed, the directory is created and initialized in the directory, with the name of the directory name.
2. We entered the created blog directory. and run the service.
1 $ cd Blog 2 $ npm Install 3 $ hexo Server
3. Open the browser and enter http://localhost:4000/in the address bar to see the first page of the blog we just created. 4. Modify the _CONFIG.YML configuration file in the blog directory to deploy the site to GitHub on its own.
1 $ vim _config.yml---> [Increase in last line]2 -------------------------------------3 Deploy: 4 type:git5 Repo:https://github.com/github-name/ Github-name.github.io.git6 Branch:master
Note that you need to add two spaces before the type, and you need to add a space after the colon of type. Keep your code style consistent. Otherwise, errors or incorrect questions may occur.
Note: If no GitHub is possible refer to another article on GitHub to create a personal site.
5. Install the Git plugin used by the deployment.
Here we are using the GIT source management tool, so I need to install the GIT package for deployment and install the plugin to use GIT for automatic deployment.
1 $ npm Install hexo-deployer-git--save
6. Create a Web site
Before we deploy the site, Mr. Need to become a static website. It automatically creates a public directory under the directory and stores the newly generated Web page in this directory.
1 $ cd Blog 2 $ hexo g
7. To automate the deployment of the site, note that the site needs to be rebuilt before deployment, and after each modification, the site needs to be rebuilt and deployed, and the 6th step before the site is generated.
1 $ hexo D
- If there is an error message in the deployment: Please refer to step 5th to install the Git plugin.
1 ERROR Deployer not Found:git
8. If the above has been successfully completed, congratulations, you have successfully completed the deployment of the site, then open your browser. Enter your website. 9. Refer to the official documentation to start a new journey.
- Hexo Official API (Chinese)
- Hexo Official document (Chinese)
Reference documents
- Hexo official website (Chinese)
- Hexo official website (English)
- Hexo Official API (Chinese)
- Hexo Official document (Chinese)
- GitHub official website
- node. JS Official documentation
- node. JS Installation Documentation
Use Hexo to frame a personal site