With hexo build GitHub blog

First, configure the GitHub

  1. Registration GitHub
    registered GitHub, and log github.com
    username will be used, first remember

  2. Creating a warehouse
    click Create a new repository
    new repository
    reposository nameFill username.github.iothis is fixed, usenamethe user name when registering, otherwise it is not possible to username.github.ioaccess the blog
    Here Insert Picture Description

  3. Warehouse set
    to enter the settings page to find GitHubpageoptions, select master branch, and then arbitrarily select a theme, you can confirm the changes
    Here Insert Picture DescriptionGitHub page

Second, the installation environment (node.js Git)

  1. 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 execution node -vto see if executed successfully
  2. Install Git
    role: local hexo submitted content up to github
    install Xcode on comes with Git, I will not say more.
  3. Installation Hexo
    execute the following command to install Hexo npm install -g hexo
    execution hexo -vview the version information to see if the installation was successful
    Install correctly
    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 pages hexo g
    locally start start local services, a preview of the article debugging commands: hexo sYou can also modify port to execute commands hexo s -p portnumwill portnum with the port you want on the line.
    Enter the browser http://localhost:4000will be able to see the initial page hexo friends.

Third, configure blog

The following three options to configure information configured usernameusername 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 dwait for the end they can username.github.ioaccess 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)

  1. The next theme downloaded to the local command executiongit clone https://github.com/iissnan/hexo-theme-next themes/next
  2. Enable the next topic, modify _config.ymlconfiguration items themefor the next
# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: matery
  1. Implementation of hexo saccess http://localhost:4040to 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

Published 50 original articles · won praise 32 · views 30000 +

Guess you like

Origin blog.csdn.net/qq_40827780/article/details/92981449