HEXO搭建博客


Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

环境依赖

环境 版本 安装命令
npm 7.21.0 npm
node V14.17.5
hexo-cli 4.3.0 npm install hexo-cli -g
hexo 5.4.0

成功构建环境:mac、windows

工程创建

npm install hexo-cli -g
hexo init blog
cd blog/themes 
git clone https://github.com/blinkfox/hexo-theme-matery.git
cd ../blog
npm install
hexo server

主题配置修改

详细:hexo-theme-matery

文章新建

hexo new "My New Post"

More info: Writing

标题写法

简单写法

---
title: typora-vue-theme Theme introduction
date: 2018-09-07 09:25:00
---

复杂写法

---
title: typora-vue-theme Theme introduction
date: 2018-09-07 09:25:00
author: Qi Zhao
img: /source/images/xxx.jpg
top: true
hide: false
cover: true
coverImg: /images/1.jpg
password: 8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92
toc: false
mathjax: false
summary: This is the content of your custom post summary. If there is a value for this attribute, the post card summary will display the text, otherwise the program will automatically intercept part of the post content as a summary.
categories: Markdown
tags:
  - Typora
  - Markdown
---

服务启动

hexo server -p 5000

More info: Server

生成静态文件

hexo generate

More info: Generating

文章发布

hexo deploy

More info: Deployment

重新发布

hexo clean && hexo deploy

鉴权问题

 13 files changed, 26 insertions(+), 26 deletions(-)
Username for 'https://github.com': huhuhuhr
Password for 'https://huhuhuhr@github.com': 
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: 'https://github.com/huhuhuHR/huhuhuhr.github.io/' 鉴权失败
FATAL {
  err: Error: Spawn failed
      at ChildProcess.<anonymous> (/Users/niejing/Documents/GitHub/blog/node_modules/hexo-util/lib/spawn.js:51:21)
      at ChildProcess.emit (events.js:400:28)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12) {
    code: 128
  }
} Something's wrong. Maybe you can find the solution here: %s https://hexo.io/docs/troubleshooting.html
niejing@niejingdeMacBook-Pro blog % hexo clean && hexo deploy 

原因:github不再通过密码鉴权,而是通过token

详细参考:鉴权

订阅问题

This XML file does not appear to have any style information associated with it. The document tree is shown below.

不好用,直接在主题给关闭了

socialLink:
  github:  https://github.com/huhuhuHR
  email: 757033301@qq.com
  facebook: # https://www.facebook.com/xxx
  twitter: # https://twitter.com/xxx
  qq: 757033301
  weibo: # https://weibo.com/xxx
  zhihu: # https://www.zhihu.com/xxx
  rss: false # true、false

文章作者: huhuhuhr
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 huhuhuhr !
  目录