First, configure the GitHub
-
Registration GitHub
registered GitHub, and log github.com
username
will be used, first remember -
Creating a warehouse
clickCreate a new repository
reposository name
Fillusername.github.io
this is fixed,usename
the user name when registering, otherwise it is not possible tousername.github.io
access the blog
-
Warehouse set
to enter the settings page to findGitHubpage
options, selectmaster branch
, and then arbitrarily select a theme, you can confirm the changes
Second, the installation environment (node.js Git)
- Installation Node.js
installed Node
role: to generate static pages of
the latest version of the official website to download the appropriate Node.js platform, all the way to installation.
Under cmd executionnode -v
to see if executed successfully - Install Git
role: local hexo submitted content up to github
install Xcode on comes with Git, I will not say more. - Installation Hexo
execute the following command to install Hexonpm install -g hexo
executionhexo -v
view the version information to see if the installation was successful
implementation of init command initializes hexo, command:hexo init
At this point, all the installation work has been completed! blog is your blog root directory, all operations are carried out inside.
Generating static pageshexo g
locally start start local services, a preview of the article debugging commands:hexo s
You can also modify port to execute commandshexo s -p portnum
will portnum with the port you want on the line.
Enter the browserhttp://localhost:4000
will be able to see the initial page hexo friends.
Third, configure blog
The following three options to configure information configured username
username when all subject to registration, the other can make custom modifications
# Hexo Configuration
## Docs: https://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/
# Site
title: xfx's blog #网页标题
subtitle: xfx's blog #网页副标题
description: All that exists is what's ahead. #网页描述
keywords:
author: xfx
language: zh-CN
timezone: Asia/Shanghai #时区
# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: http://username.github.io #网页网址
root: /
permalink: :year/:month/:day/:title/
permalink_defaults:
deploy:
type: git
repo: https://github.com/username/username.github.io.git #GitHub仓库
branch: master
Here install git deployment tool to performinstall -- save hexo-deployer-git
The first submission will be asked to set up mailboxes and user name, set yourself up on the line, after the user will be prompted to enter the password required to enter.
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
And then you do hexo g
hexo d
wait for the end they can username.github.io
access the blog.
Fourth, set the skin
Here is an example of a skin of my blog xfx98.github.io
if the Chinese can be directly taken away, HEXO-Theme-matery
(though I will move it on your own blog, and do custom modifications. Then respect for copyright, I still see it the original author of 2333)
page has Chinese documents, and detailed configuration, and installation of some plug-ins, not go into here.
There is also a more classic theme of next installation (execute the following command in the blog root directory)
- The next theme downloaded to the local command execution
git clone https://github.com/iissnan/hexo-theme-next themes/next
- Enable the next topic, modify
_config.yml
configuration itemstheme
for the next
# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: matery
- Implementation of
hexo s
accesshttp://localhost:4040
to see whether success
Then some of the topics is to configure it, next there are three themes, you can choose your favorite one.
Some commonly used commands
hexo new"postName"
New article #
hexo new page"pageName"
# New Page
hexo g
# generate static pages to the public directory
hexo s
# Enable preview access port (default port 4000, 'ctrl + c' Close Server)
hexo d
# .deploy directory will be deployed to GitHub
hexo version
# View Hexo version