hexo-插件

hexo-插件

十一月 24, 2020

    

Github: https://github.com/rozbo/hexo-abbrlink
A Hexo plugin to generate static post link based on post titles.

    根目录右键git bash here,下载插件:

1
npm i hexo-abbrlink --save

    在站点根目录的_config.yml内配置:
    修改permalink

1
permalink: posts/:abbrlink/

    加入下方配置:

1
2
3
4
# abbrlink config
abbrlink:
alg: crc32 #support crc16(default) and crc32
rep: hex #support dec(default) and hex

example: https://blog.imciraos.com/posts/5a3fb175

hexo-generate-feed

Github: https://github.com/hexojs/hexo-generator-feed
demo: https://blog.imciraos.com/atom.xml
In the front-matter of your post, you can optionally add a description, intro or description setting to write a summary for the post. Otherwise the summary will default to the description or the first 140 characters of the post.

    下载插件:

1
npm i hexo-generate-feed --save

    再在根目录站点配置文件_config.yml内加入如下配置:

1
2
3
4
5
6
7
8
9
10
11
12
13
# feed - RSS
feed:
type: atom
path: atom.xml
limit: 20
hub:
content: false
content_limit: 140
content_limit_delim: 25
order_by: -date
icon: icon.png
autodiscovery: true
template:

    在主题配置文件中加入链接:
    我建议加在social icons处:

1
2
3
4
5
# social settings (社交圖標設置)
# formal:
# icon: link || the description
social:
iconfont icon-RSS: /atom.xml || RSS

其中,

  • iconfont icon-RSS为窝添加的aliyun iconfont 图标。当然,你也可以自定义,fontawesome也可以。

hexo-bilibili-bangumi

    在这里:增加bilibili-追番列表

hexo-offline-popup

hexo-offline-popup是一个hexo插件, 它可加速您的Hexo网站的加载速度,以及网站内容更新弹窗提示。

    在博客根目录右键单击Git bash here,输入下面这一行代码,来下载插件。

1
npm install hexo-offline-popup --save

之后,在博客根目录_config.yml内引入下面代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# offline config passed to sw-precache.
service_worker:
maximumFileSizeToCacheInBytes: 5242880
staticFileGlobs:
- public/**/*.{js,html,css,png,jpg,gif,svg,eot,ttf,woff,woff2}
stripPrefix: public
verbose: true
directoryindex: false
runtimeCaching:
- urlPattern: /*
handler: cacheFirst
options:
origin: alicdn.com
- urlPattern: /npm/*
handler: cacheFirst
options:
origin: cdn.jsdelivr.net
- urlPattern: /*
handler: cacheFirst
options:
origin: ftp.bmp.ovh
- urlPattern: /*
handler: cacheFirst
options:
origin: i.loli.net
  • urlPattern,注意通配符。cdn.jsdelivr.net域名中有npm,故将此域名填在此origin处。

  • origin可以用来输入自己引用的外链的域名,例如alicdn.comcdn.jsdelivr.neti.loli.net等等。

    部署!

1
hexo cl && hexo g && hexo d

hexo-filter-nofollow

Add nofollow attribute to all external links automatically.

hexo-generator-sitemap

咕咕咕