想设置如下图所示的动态背景,搜了很久没找到适用自己的。通过github源头轻松解决。
源文件README
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| Step 1 → Go to Hexo dir
Change dir to Hexo directory. There must be scaffolds, source, themes and other directories:
$ cd hexo $ ls scaffolds source themes _config.yml package.json
Step 2 → Create footer.swig
Create a file named footer.swig in hexo/source/_data directory (create _data directory if it does not exist).
Edit this file and add the following content:
<script color="0,0,255" opacity="0.5" zIndex="-1" count="99" src="https://cdn.jsdelivr.net/npm/canvas-nest.js@1/dist/canvas-nest.js"></script>
You can customize these options. Step 3 → Set it up
In the NexT _config.yml, uncomment footer under the custom_file_path section.
# Define custom file paths. # Create your custom files in site directory `source/_data` and uncomment needed files below. custom_file_path: #head: source/_data/head.swig #header: source/_data/header.swig #sidebar: source/_data/sidebar.swig #postMeta: source/_data/post-meta.swig #postBodyEnd: source/_data/post-body-end.swig footer: source/_data/footer.swig #bodyEnd: source/_data/body-end.swig #variable: source/_data/variables.styl #mixin: source/_data/mixins.styl #style: source/_data/styles.styl
|
参考来源:https://github.com/theme-next/theme-next-canvas-nest