Hexo Free Blog (WIN)

Source: Internet
Author: User

Build the Environment
    1. Install node. js: http://nodejs.org/en
    2. Install Git: Https://github.com/waylau/git-for-win
    3. Set git: Open directly Git Bash or from 开始 Git Bash . Enter the following code, respectively:
git config --global user.name "yourname"
git config --global user.email "[email protected]"

Pay attention to replacing it with your own.

    1. Install Hexo: In the Git Bash input
npm install -g hexo-cli

npm install -g-gThe meaning is global installation.

Here you need to wait for one end of time. The $ indicated does not appear to be downloading the installation.

Configure coding or GitHub (here coding for example) to create a warehouse

Join key

Git BashInput in:

ssh-keygen -t rsa -C "Coding或Github的注册邮箱地址"

will appear a few choice operation, do not understand the default, all the way to the return.

The computer directory C:\Users\你的用户名 found the .ssh directory (no View hidden folder), enter, copy the id_rsa.pub content.

It is recommended to use notepad Open text.

Copy to 2. Internal

Initialize Blog
    1. Create your own folders locally.
    2. In the Files folder, Right-click to select Git Bash Input:
hexo init blog

Success will prompt:! NFO Start Blogging with hexo!

    1. Local preview

First confirm whether under the blog directory, if not, enter:

cd blog
$ hexo generate# 启动本地服务器$ hexo server# 在浏览器输入 http://localhost:4000/就可以看见网页和模板了INFO  Start processingINFO  Hexo is running at http://localhost:4000/. Press Ctrl+C to stop.

Open in Browser: localhost:4000

Configure Blog

In the blog directory, sublime/notepad++ open the configuration parameters with an equal text editor _config.yml .

It is important to note that after each parameter : there is a space.

Modify site Information
title: 标题subtitle: 副标题description: 网页描述author: 作者language: zh-CNtimezone: Asia/Shanghai
Configuring Deployment Information
deploy:  type: git  repo: [email protected]:StarryTree/Hexo.git  branch: master

repo:The content can be found on the coding or GitHub warehouse code page.

Configure Uniform Resource Locator
# URL## If your site is put in a subdirectory, set url as ‘http://yoursite.com/child‘ and root as ‘/child/‘url: https://starrytree.cnroot: /permalink: :year/:month/:day/:title/permalink_defaults:

If you have a personal domain name can be set, otherwise skip. If it is a Github.io URL, you can also fill in.

rootother information, such as (root directory), permalink (permalink), permalink_defaults (default permalink), remains the default.

Because coding is assigned a directory, it is required root: 项目名称 .

Published articles
    1. New blog post:

Git BashInput below:

hexo new "文章名称"

INFO created:c:\1\document\git\hexo\blog\source_posts\test.md

    1. Open the file as prompted.

The editor needs to use the markdown syntax. Markdown Syntax Instructions (Simplified Chinese version)

Recommended Header documents:

---title: title #文章标题date: 2017-09-08 23:47:44 #文章生成时间categories: "Hexo教程" #文章分类目录 可以省略tags: #文章标签 可以省略     - 标签1     - 标签2 description: #你对本页的描述 可以省略---
    1. Then in the blog directory, enter the following series (three) command:
F:\test\blog$ hexo cleanINFO  Deleted database.INFO  Deleted public folder.$ hexo generateINFO  Start processingINFO  Files loaded in 1.48 s#省略INFO  29 files generated in 4.27 s$ hexo serverINFO  Start processingINFO  Hexo is running at http://localhost:4000/. Press Ctrl+C to stop.

Local preview: http://127.0.0.1:4000

    1. Publish to the remote repository. Execution hexo deploy :
F:\test\blog$ hexo deployINFO  Deploying: gitINFO  Clearing .deploy_git folder...INFO  Copying files from public folder...#省略
PostScript Supplement

The first push may require:

After the first push, please open the page service on the Coding code page.

Hexo Free Blog (WIN)

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.