🔵hexo博客搭建

本文最后更新于:2023年7月28日 凌晨

1.安装依赖包

1
npm install -g hexo-cli

2.初始化

1
2
hexo init
npm install

3.关联github

清除缓存

该命令会清除手动添加至public目录中的文件

把静态图片放入source目录可自动复制到public目录且不会清除

1
hexo clean

上传博客

1
2
hexo g[enerate]
hexo d

本地服务器

1
2
hexo g
hexo s[erver]

给文章加封面

  • /source/img中放入图片

  • 在开头Front-matter中配置 index_img 属性如下

1
index_img: [url]

给文章加图片

_config.yml中设置post_asset_folder: true

1
post_asset_folder: true

新建文章

1
hexo n "title"

_post下的title文件夹中放入图片

用markdown引用

1
![加载失败信息](title\xxx.png)

分类页

  1. 创建分类页
1
hexo new page categories
  1. source/categories/index.md开头Front-matter中添加type: "categories"如下
1
2
3
4
5
---
title: categories
date: 2022-01-15 21:30:40
type: "categories"
---
  1. 在博客的头部添加categories: - type即可分类
1
2
3
4
---
title: hexo博客搭建
categories: [categories1, categories2]
---

标签页

  1. 创建标签页
1
hexo new page tags
  1. source/tags/index.md开头Front-matter中添加type: "tags"如下
1
2
3
4
5
---
title: categories
date: 2022-01-15 21:30:40
type: "tags"
---
  1. 在博客的头部添加tags: [tag1, tag2, ...]即可分类
1
2
3
4
---
title: hexo博客搭建
tags: [tag1, tag2]
---

valine评论

《快速开始》

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
valine:
appId: <appId>
appKey: <appKey>
path: window.location.pathname
placeholder: 畅所欲言吧!!!
avatar: 'retro'
meta: ['nick', 'mail', 'link']
requiredFields: ['nick']
pageSize: 10
lang: 'zh-CN'
highlight: false
recordIP: false
serverURLs: <REST API 服务器地址>
emojiCDN:
emojiMaps:
enableQQ: false

🔵hexo博客搭建
https://qingshaner.com/hexo博客搭建/
作者
清山
发布于
2022年1月16日
许可协议