Hexo的Plugin與使用

Plugin安裝方法

Hexo Plugin官方網頁:https://hexo.io/plugins/

基本命令

1
2
3
4
5
6
#安裝
npm install <plugin> --save
#解除安裝
npm uninstall <plugin> --save
#更新plugin & Framework(under Hexo Dir)
npm update

追加指令

先安裝npm-check-update

1
2
#Manjaro環境
pacman -S npm-check-update

有用的指令

1
2
3
4
5
6
7
8
9
#確認哪些package過期了
npm outdate

#確認是否有最新的package
npm-check-update
#update package.json
ncu -u
#更新package
npm install

另外,當git clone下整個Blog(包含package.json)時可以不用重新下安裝指令

1
2
#依照package.json更新整個node_module
npm update

本站有安裝的Plugin

相關設定

Render-markdown-it-plus Section

1
2
3
4
5
6
7
8
9
10
markdown_it_plus:
highlight: true
html: true
xhtmlOut: true
breaks: true
langPrefix:
linkify: true
typographer:
quotes: “”‘’
pre_class: highlight

Deployment Section

1
2
3
4
deploy:
type: git
repo: https://github.com/<Username>/<username>.github.io
branch: <branch_name>

Hexo-html-minifier

1
2
3
4
5
6
7
8
9
10
11
html_minifier:  
collapseBooleanAttributes: true
collapseWhitespace: true
# Ignore '<!-- more -->' https://hexo.io/docs/tag-plugins#Post-Excerpt
ignoreCustomComments: [ !!js/regexp /^\s*more/]
removeComments: true
removeEmptyAttributes: true
removeScriptTypeAttributes: true
removeStyleLinkTypeAttributes: true
minifyJS: true
minifyCSS: true