Hoxe installation and building a personal blog

Official document

Hexo

1. What is Hexo?

Hexo is a fast, concise and efficient blog framework

2. Install Git Bash

Download link: Git Bash .
Installation steps: double-click exe, select the installation path, all the way next.
After installation, right-click in the folder and you can see the icon to indicate that the installation is successful.
Open git bash and check the version:
command:

git version

3. Install Nodejs

Steps
Check the version after installation:
Command:

node -v

Install npm at the same time, you can check the version

npm -v

4. Install Taobao mirror

npm install -g cnpm --registry=https://registry.npm.taobao.org

View

cnpm

5. Install hexo-cli

cnpm install -g hexo-cli

6. Initialize the project

cd desktop
 
mkdir blog
 
cd blog
hexo init
cnpm install --save hexo-deployer-git

7. 配置 _config.yml

type: git
repo: (这里使用自己的GitHub博客仓库链接)
branch: master


8. Push to remote warehouse

You can check the effect locally first

//重新生成
hexo g
//Start开启本地服务器,可访问
hexo s

Open the local URL
http://localhost:4000/

hexo d

Open the URL
https://hcq29.github.io

9. Change the theme

git clone https://github.com/litten/hexo-theme-yilia.git themes/yilia

Change the configuration file to change theme:landscape in _config.yml to theme:yilia

 //清理一下
hexo clean
//重新生成
hexo g
Start
hexo s

10. Add search function

(1) profile

Note no space before each section
1, the space within the configuration file to find the file and paste
2, the first line jsonContent: i.e. no space before the next line in FIG. 96
97,98,99 row a space before
the rest are Two spaces
(2) and then run

npm i  hexo-generator-json-content --save

(3) Set the image
storage location The storage location of the
avatar/icon image is anywhere under /themes/yilia/source/. You can create a new folder to store it yourself. I store it in the assets folder.
Configuration settings The
configuration file is /themes/yilia/_config.yml. Set the avatar as the avatar item in the configuration file, set the icon as the favicon item in the configuration file, and set the root directory of the path to /themes/yilia/source/. For example, the address where my avatar is stored is /themes/yilia/source/assets/me.png, and the setting is avatar: /assets/me.png. (The same applies to the icon)




    $ hexo d
    //发上错误 ERROR Deployer not found: git
    npm install --save hexo-deployer-git

That's it.

11. New article

    //新建文章
    hexo new post page1 //这里的page1是新建文章的链接名称
    //新建草稿
    hexo new draft page2 //存储的是草稿page2
    //发布草稿
    hexo publish page2

Guess you like

Origin blog.csdn.net/weixin_42339197/article/details/102839294