Build hexo3.0 Blog under Mac

Source: Internet
Author: User
Tags install node git clone sourcetree

Build hexo3.0 Blog under Mac (article Sync from personal blog site and GitHub blog https://xingstarx.github.io/) Hexo Blog under window environment

Details can be included in this article on how to build an independent blog-The Concise GitHub pages and Hexo tutorial I blog building process is also involved in the above part of the content.

Install node. js and git install node. js

Download the file with the suffix pkg to the node. JS site and click Install.
Enter at the end of the terminal

node -vnpm -v

If there is no error, the version is displayed

I have information such as the following:

Hexo git: (Master)? Node-v

v0.12.5

Hexo git: (Master)? Npm-v

2.11.2

Install Git

Mac installs Xcode, otherwise there will always be a variety of problems, as far as possible according to standard practice, detailed procedures such as the following:

Install Xcode, launch Xcode, and enter the command line tools----Preferences----Download.

After the installation is complete. Input command Check

Hexo git: (Master)? Git–version

git version 2.3.2 (Apple Git-55)

Installing Hexo

Under one of the folders. Create a temporary folder, such as Xingstarx, through the terminal command, enter the folder below.

Execute command

-g hexo-cli

May prompt an error, cannot be installed, the problem is on the root user

You need to start the installer by following
, and it's getting better for a while.

-g hexo-cli
Build Station

Then the above operation, created a folder named Hexo, (here can create a random name, choose your favorite)

{% Codeblock%}
Hexo Init Hexo
CD Hexo
NPM Install
{% Endcodeblock%}

Create a folder structure for your blog

This folder can be managed through git, (git init)
I'm working with Sourcetree, creating a local git repository, and then getting ready to build a remote repository, the GitHub repository.

Open GitHub Account

To register your github account, register your username and email. This step for developers, it should not be difficult, I believe that everyone can handle.

After the registration is complete. Login Enter the mailbox name, password, create a repository (this piece will not put the picture, we can see this link to the corresponding article pictures. Set up the warehouse), my name is Xingstarx.github.io, the name of the front is your GitHub account name, need to be consistent. Create your own repo.

Git repository

Through the source tree software. To the local Hexo warehouse to join the remote library, (to Sourcetree software is unfamiliar with the Google Tutorial), click Remotes, join the remote library

(This changes the local library.) Ability to push local code to remote repository)

Configuration

Change the contents of the _config.yml file, the _config.yml file is stored under the Hexo root folder, change the title. Url. New_post_name and other information, one thing to be aware of IS.

titlexingstar‘s blogs 

Title: There is a space, you must pay attention to. Otherwise, it will go wrong later.

Some of my changes are as follows:

title: xingstar‘s blogs
url: http://xingstarx.github.ionew_post_name: :year-:month-:day-:title.md# File name of new posts
deploy:  type: git  repo: https://github.com/xingstarx/xingstarx.github.io.git  branch: master

It is also important to note that the Deploy method. Is the type of git, not GitHub. HEXO3.0 have to use this way, and then configure their own repo. and branch

Other than that. Re-introduce the content of the theme change

git clone https://github.com/wuchong/jacman.git themes/jacman

Added a theme that requires a change in the configuration file to change the original value to Jacman

theme: jacman
Write a blog

The following is a description of the content of the blog. Under the Hexo folder, start the terminal, or switch to the Hexo folder in a different way, create the article as follows

? Xingstarx Hexo New Post first experience Hexo

A markdown file is created for a blog post that is named first experience Hexo.

Because the markdown file that I set up earlier (New_post_name:: year-:month-:d ay-:title.md # file name of new posts) also takes a time prefix. The detailed file is/2015-06-24-first experience under the Hexo/source/_posts folder hexo.md
Then you can edit the article through the Markdown Editor, add the content of the article, recommend a markdown editor MoU is also more convenient to use. Here's what I'm writing about. The beginning part is self-generated, including the title. Time and other information

title: 初次体验hexodate:2015-06-2416:32:12tags:安装git和nodejsmac下安装gitmac下安装nodejs,在nodejs.org上面下载pkg文件安装hexo

Just write so much, and when you're done, execute the following series of commands:

#生成文件#启动server(有提示,怎么訪问的)#部署到线上。也就是github上面以下部署环节相当于包括进去了,请注意下

Build hexo3.0 Blog under Mac

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.