Hexo build GitHub static blog (Windows)

Source: Internet
Author: User
Tags sublime text

1: Register your GitHub account and create a new repository (the warehouse name must be "Your_user_name. Github.io")

2: Configure GitHub Ssh-key The general installation of GitHub will be configured first Ssh-key

3: Use NPM (First install Nodejs node: http://nodejs.org/) to install Hexo to global (for Hexo installation configuration process, please take the official Hexo "2" to the steps given) official address: https://hexo.io/

4: After all is configured, first right-click Git Bash in the folder where you want to store the project, then use git clone [email protected]:iifred/iifred.github.io.git (This is the address of your own new warehouse) to get the warehouse file

5: (Continue typing in the Git bash window above) $ hexo init (Hexo then automatically creates the files needed for the site in the destination folder. Then continue with the NPM install Node_modules installed in the directory. After the installation is complete, you can execute Hexo server to open the running project

Http://localhost:4000/hexo Server-p (port number) You can specify the port to run

6: After running OK locally we'll sync him to GitHub, first we enter (continue typing in the Git bash window above) Hexo generate after the command executes, a series of html,css and other files are generated in the D:\Hexo\public\ directory.

Hexo new "My new Post" generates a markdown file in the D:\Hexo\source\_posts directory: my-new-post.md

You can use an editor that supports markdown syntax (such as Sublime Text 2) to edit the file.

Before deploying to GitHub, you need to configure the _config.yml file, first find the following content

# deployment## Docs:http://hexo.io/docs/deployment.htmldeploy:  type:

They are then modified to

# deployment## Docs:http://hexo.io/docs/deployment.htmldeploy:  type:github  repository:iifred/ Iifred.github.io.git  Branch:master

Note that a space is required after the colon

After the configuration is complete we only need to execute these 3 commands to see the effect in http://iifred.github.io/(iifred own username)
Hexo Cleanhexo Generatehexo Deploy
Join you when performing a deploy without effect is estimated to be a version issue
You can first install a NPM installed Hexo-deployer-git--save
_config.yml file found Deploy:type:git
Note the format!!!
If not, then Baidu to own.
such as: http://www.v2ex.com/t/175940
You can use Hexo-version to view your version
Other more about Hexo set up the more exciting!!

Hexo build GitHub static blog (Windows)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.