优化写博客体验
在hexo博客使用在线图片
在博客使用图床更节省空间,也能加快博客的加载速度。但不知道为什么我在使用在线图片时无法加载,百度一下后找到了解决方法。
<meta name="referrer" content="no-referrer"/>
在文章开头加上以上代码就解决了。
使用音乐播放器
使用iframe插件
<iframe
frameborder="no" border="0" marginwidth="0"
marginheight="0" width=330 height=86
src="//music.163.com/outchain/player?type=2&id=461544312&auto=0&height=66">
</iframe>
- 效果
可以通过更改id选择歌曲,id可以在分享连接中获取,有些歌曲可能不能播放。
更换markdown渲染器
hexo自带使用hexo-renderer-marked
渲染器,但是这个渲染器不支持复杂数学公式,也不支持很多语法,因此我们使用@upupming/hexo-renderer-markdown-it-plus
渲染器,功能比较多。
1.卸载原来的渲染器
npm uninstall hexo-renderer-marked --save
2.下载新的渲染器
npm i @upupming/hexo-renderer-markdown-it-plus --save
- 渲染器自带的plugins
- markdown-it-emoji 支持emoji
:smile:
->😄 - markdown-it-sub 支持
H~2~o
-> H2o - markdown-it-sup 支持
X^2^
-> X2 - markdown-it-ins 支持
++Inserted++
->Inserted~~Del~~
->Del - mardown-it-katex 支持kater公式
- markdown-it-toc-and-anchor 支持
@[toc]
生成目录
- markdown-it-emoji 支持emoji
每次部署github page后域名失效
在source文件夹添加CNAME
无后缀文件,在文件中写入域名。
代码高亮插件 Hexo-Prism-Plugin
安装
npm i -S hexo-prism-plugin
配置参考Hexo-Prism-Plugin文档
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Pluto404`s blog!