文章摘要
GPT 4
此内容根据文章生成,并经过人工审核,仅用于文章内容的解释与总结
投诉

前言

如果你的 hexo 博客只是普通的搭建完成,那么也会缺少一些新意。下面是一些实用的hexo插件。

hexo插件集

  1. 安装:
1
npm install hexo-abbrlink --save
  1. 当你hexo g时,这个插件会对未生成abbrlink的文章中的front matter里添加这个东西(据说此种格式有利于SEO优化):
1
abbrlink: *****(随机数字)
  1. 也可以自定义,尽量使用字母和数字,空格用-替代,提升链接可读性。
1
abbrlink: 我的文章-my-post-*****

hexo-encrypt

  1. 安装
1
npm install --save hexo-blog-encrypt
  1. 在front matter里输入password: 你的密码,如:
1
password: hello
  1. 那么在hexo中就是这样的画面:

加密后

  1. 可以添加更多,如:
1
2
3
4
5
6
7
8
9
10
---
title: Hello World
date: 2016-03-30 21:12:21
password: 114514
abstract: 有东西被加密了, 请输入密码查看. //系统信息
message: 您好, 这里需要密码. //展示的信息
wrong_pass_message: 抱歉, 这个密码看着不太对, 请再试试. //密码错误
wrong_hash_message: 抱歉, 这个文章不能被校验, 不过您还是能看看解密后的内容. //hash解密错误
---

或者在_config.yml里添加这些东西:

1
2
3
4
5
6
7
8
# Security
encrypt: # hexo-blog-encrypt
abstract: 有东西被加密了, 请输入密码查看.
message: 您好, 这里需要密码.
theme: xray
wrong_pass_message: 抱歉, 这个密码看着不太对, 请再试试.
wrong_hash_message: 抱歉, 这个文章不能被校验, 不过您还是能看看解密后的内容.

hexo-generator

  1. 安装(先第一个后第二个)
1
npm uninstall hexo-generator-index --save
1
npm install hexo-generator-index-pin-top --save
  1. 在front matter里添加top: ***数字越大文章越靠前
1
top: 114514

hexo-hide-posts

  1. 安装
1
npm install hexo-hide-posts --save
  1. 默认 hidden: true 用于隐藏,可以修改成false

hexo-generator-feed

  1. 安装
1
npm install hexo-generator-feed --save
  1. 当你hexo d时会生成用于rss订阅,默认只获取文章摘要或者前140个字符

hexo-filter-nofollow

  1. 安装
1
npm i hexo-filter-nofollow --save
  1. 可排除自定义域名。

hexo-submit-urls-to-search-engine

  1. 安装
1
npm install --save hexo-submit-urls-to-search-engine
  1. hexo d时自动提交链接到搜索引擎。提交效果不错,但百度放出页面的速度依旧感人,谷歌、必应、雅虎的收录速度很快。

markdown-it-ruby 与 hexo-pinyin-ruby-marks

  1. 安装
1
npm install markdown-it-ruby --save
1
npm install hexo-pinyin-ruby-marks
  1. _config.yml中输入以下内容:
1
2
3
markdown:
plugins:
- markdown-it-ruby
  1. 在文章中输入以下内容:
1
{% pinyin 初音未来|chu1 yin1 wei4 lai2 %} 
  1. 即可看到文字上的拼音注音效果

hexo-pangu

  1. 安装
1
npm install hexo-pangu
  1. 送给所有中英混输必须加空格的强迫症患者。(但愿跟其它插件不存在冲突)
  1. 安装
1
npm install hexo-broken-links-checker --save-dev
  1. 检查
1
npx hexo check-links
  1. 等待一会就会出现:
1
2
WARN  The following links are broken:
- https://

hexo-tag-qrcode

  1. 安装
1
npm i hexo-tag-qrcode
  1. 在文章中输入:
1
{% qrcode "自定义内容" %}

后记

文章中的插件可以评论提示我你喜欢的插件,我可能会采纳!

版权所有©MC-Sep 2024.