【Hexo】常用插件
本文最后更新于:2 个月前
1、hexo-deployer-git
hexo-deployer-git
Hexo 支持一键部署网站到 git 仓库上,其他的一键部署方式参考 官网介绍
- 安装
1
npm install hexo-deployer-git --save
- 配置
1
2
3
4
5
6
7
8
9# Deployment
## Docs: https://hexo.io/docs/one-command-deployment
deploy:
- type: git
repository: git@github.com:calmzo/calmzo.github.io.git # <仓库链接> # 可以是 https 链接也可以是 git 链接
branch: gh-pages # [分支] # GitHub 的网站分支为 gh-pages,其他网站可能有所不同
- type: git
repository: git@gitee.com:Calm-Chan/Calm-Chan.git # <仓库链接> # 可以是 https 链接也可以是 git 链接
branch: gh-pages # [分支] # GitHub 的网站分支为 gh-pages,其他网站可能有所不同
2、生成非中文的链接
- 安装
1 |
|
- 配置
首先修改 _config.yml 文件中的 permalink 的配置
1 |
|
3、收录
hexo-generator-sitemap
为了使博客能被谷歌、bing、百度收录,最好生成 sitemap 方便爬取,整体流程可以先参考这篇博文
安装
1
npm install hexo-generator-sitemap --save
配置
1
2
3
4
5
6
7
8# hexo-generator-sitemap
## https://github.com/hexojs/hexo-generator-sitemap
sitemap:
path: sitemap.xml
# template: ./sitemap_template.xml
rel: true
tags: false
categories: false
4、hexo-filter-github-emojis
安装
1
npm install hexo-filter-emoji
配置
在站点配置文件 .config.yml 中增加:1
2
3
4
5
6emoji:
enable: true
className: github-emoji
inject: true
styles:
customEmojis:使用方法
输入对应的 emoji 编码就行了,这个是两种方法都通用的
例如:输入笑脸对应的 emoji 编码 : smile : 就可以得到 😄方法二额外的用法:
如果你不喜欢 :: 这种方法,你还可以这样采用 tags 的方式:1
{% emoji sparkles %}
为了避免有时候 :: 带来的解析问题,我们可以在 front-matter 中添加 no-emoji: true 来禁用 :: 的方式:
1 |
|
- 参考资料:
Hexo 中使用 emoji 表情
5、添加 RSS 订阅支持
- 安装
1
npm install hexo-generator-feed --save
- 配置
1
2
3
4
5
6
7
8
9
10# 添加 RSS 订阅支持(可选的)
feed:
type: atom
path: atom.xml
limit: 20
hub:
content:
content_limit: 140
content_limit_delim: ' '
order_by: -date
【Hexo】常用插件
https://calmchen.com/posts/468ec796.html