Build hexo3.0 Blog under Mac (article Sync from personal blog site and GitHub blog https://xingstarx.github.io/) Hexo Blog under window environment
Specific content can refer to this article how to build an independent blog-The Concise GitHub pages and Hexo tutorial I blog building process is also reference to 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 website and click Install.
Enter at the end of the terminal
node -vnpm -v
If there is no error, the version number is displayed
My information is as follows:
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 the standard practice, the following:
Install Xcode, launch Xcode, and enter the command line tools----Preferences----Download.
When the installation is complete, enter command detection
Hexo git: (Master)? Git–version
git version 2.3.2 (Apple Git-55)
Installing Hexo
Under a folder, create a temporary directory, such as Xingstarx, through the terminal command, into the directory below.
Execute command
NPM install-g hexo-cli "may be prompted to error, unable to install, the problem is that the root user needs to start the installer through the following, so that a period of time to become better" ' bashsudoNPM install-g hexo-cli "<div class="Se-preview-section-delimiter"></div># # Build StationThen the above operation, created a folder named Hexo, (here you can create any name, choose your favorite) {% Codeblock%}hexo init HexoCDHexo npm Install {% Endcodeblock%} Create a directory structure for blogs Here you can manage the directory via Git (git init) I'm through [Sourcetree] (https://www.sourcetreeapp.com/ ) to operate, create a local git repository, and then start preparing to build a remote repository, the GitHub warehouse <div class="Se-preview-section-delimiter"></div># # Open GitHub accountRegister [GitHub] (http://www.github.com/) account, register your own username and mailbox, this step for developers, it should not be difficult, I believe we can handle. After the registration is completed, login enter the mailbox name, password, create a repository (this piece will not put the picture, you can see this link corresponding to the picture of the article, [Build Warehouse] (http://cnfeat.com/ the/ to/Ten/ the- to- One-how-to-build -A-blog/#github上建立仓库)), my name is Xingstarx.github.io, and the previous name is the name of your GitHub account, which needs to be consistent. Create your own repo. <div class="Se-preview-section-delimiter"></div># # Git repositoryPassSourceTree software, to the local Hexo warehouse to add remote library, (Sourcetree software is not familiar with the Google next tutorial), click Remotes, add remote library (so modify the local library, you can push local code to the remote warehouse) <div class="Se-preview-section-delimiter"></div># # ConfigurationModify the contents of the _config.yml file, the _config.yml file is stored under the Hexo root directory, modify the Title,url,new_post_name and other information, one thing to note is that <div class="Se-preview-section-delimiter"></div> ' Bashtitle:xingstar' s Blogs
Title: There is a space, you must pay attention to, otherwise it will be wrong.
The parts I modified 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's also important to note that the type of the Deploy mode is git, not github,hexo3.0, and then configure its own repo, and branch
In addition, we introduce the content of the modified topic
git clone https://github.com/wuchong/jacman.git themes/jacman
Added a theme that needs to be modified in the config file to change the original value to Jacman
theme: jacman
Write a blog
The following is the content of the blog, in the Hexo directory, start the terminal, or other ways to switch to the Hexo directory, the following way to create the article
? Xingstarx Hexo New Post first experience Hexo
A markdown file is created for a blog post that is named first experience Hexo. The markdown file generated by the previous I set (new_post_name:: year-:month-:d ay-:title.md # file name of new posts) also takes a time prefix. The specific file is/2015-06-24-first experience in the Hexo/source/_posts directory 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, the following is what I write, the beginning is automatically generated, including 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, run the following series of commands:
#生成文件#启动服务器(有提示,怎么访问的)#部署到线上,也就是github上面下面部署环节相当于包含进去了,请注意下
Deployment
When deploying, you need to be aware that each time you make a local change, sync to the GitHub remote Library and keep it consistent, and when you've finished writing your blog locally, follow the three commands above, the first two commands are locally observable, and the last command is a real deployment operation. It's a long time (remember the first time is very long.) )
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Build hexo3.0 Blog under Mac