在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]生成目录

每次部署github page后域名失效

在source文件夹添加CNAME无后缀文件,在文件中写入域名。

代码高亮插件 Hexo-Prism-Plugin

安装

npm i -S hexo-prism-plugin

配置参考Hexo-Prism-Plugin文档