前言
记录最近在配置Hexo博客时,发现或学习到以往没有发现的知识。
善用外挂标签
在之前的hexo文章中,没有使用外挂标签,文字堆叠在一起或比较散乱,即使文章段落分明,但是阅读起来就是没有主次之分,或者印象不深刻,比如以下文字是没有使用外挂标签的
在之前的hexo文章中,没有使用外挂标签,文字总是堆叠在一起,或者比较散乱,看着都没有注意到 重点,比如这段文字是没有使用外挂标签的
有了外挂标签,可以使文章看起来更有段落感,段落标签不仅可以改变颜色,butterfly主题还提供了ICON的标签,以下是一些示例,官方文档:标签外挂
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| {% note 'fab fa-cc-visa' simple %} 你是刷 Visa 還是 UnionPay {% endnote %} {% note blue 'fas fa-bullhorn' simple %} 2021 年快到了.... {% endnote %} {% note pink 'fas fa-car-crash' simple %} 小心開車 安全至上 {% endnote %} {% note red 'fas fa-fan' simple%} 這是三片呢?還是四片? {% endnote %} {% note orange 'fas fa-battery-half' simple %} 你是刷 Visa 還是 UnionPay {% endnote %} {% note purple 'far fa-hand-scissors' simple %} 剪刀石頭布 {% endnote %} {% note green 'fab fa-internet-explorer' simple %} 前端最討厭的瀏覽器 {% endnote %}
|
SEO的优化
使用hexo-seo-submit
插件,每天自动提交最新文章链接(或本地手动)至搜索引擎,让搜索引擎更快的收录文章。
使用方式:(举例bing)
安装:npm install hexo-seo-submit
在根目录中的 _config.yml 中配置插件。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| hexo-seo-submit: CI: enable: true baidu: enable: true google: enable: true bing: enable: true
deploy: type: git repo: https://github.com/<username>/<project> ignore_hidden: false
|
在 github仓库中配置环境变量,打开Settings->Secrets and variables->Actions->New repository secret,把bing的令牌填上,name为BING_APIKEY,Secret为令牌
获取Bing的令牌,设置->API访问->API密钥