hexo next主题下怎么添加canvas_nest背景
我的hexo next是V7.5.0版本
- 修改主题配置文件
打开/next/_config.yml
,Ctrl+f
找到Canvas-nest
,将enable
改为true
接下来有两种方法:1
2
3
4
5# Canvas-nest
# Dependencies: https://github.com/theme-next/theme-next-canvas-nest
# For more information: https://github.com/hustcc/canvas-nest.js
canvas_nest:
enable: true
方法一:修改布局文件
打开next/layout/_layout.swig
,在<body></body>
标签内添加以下代码方法二:下载插件1
2
3
4
5{% if theme.canvas_nest %}
<script type="text/javascript"
src="//cdn.bootcss.com/canvas-nest.js/1.0.0/canvas-nest.min.js">
</script>
{% endif %}canvas-nest
然后运行以下代码重新构建1
2git clone https://github.com/theme-next/theme-next-canvas-nest
themes/next-v7.5.0/source/lib/canvas-nest1
hexo clean && hexo g && hexo s