【笔记】NexT8.8中添加自定义代码

前言

NexT8.8中添加自定义代码

开启配置

  • 取消主题配置需要添加代码的位置对应的注释
hexo/_config.next.yml
1
2
3
4
5
6
7
8
9
10
11
custom_file_path:
#head: source/_data/head.njk
#header: source/_data/header.njk
#sidebar: source/_data/sidebar.njk
#postMeta: source/_data/post-meta.njk
#postBodyEnd: source/_data/post-body-end.njk
#footer: source/_data/footer.njk
#bodyEnd: source/_data/body-end.njk
#variable: source/_data/variables.styl
#mixin: source/_data/mixins.styl
#style: source/_data/styles.styl

添加组件

  • hexo/_data/目录下创建对应文件名的组件文件
    • 想要写HTML文件或在HTML文件插入JS代码,需要使用.njk文件
    • 想要写CSS文件,需要使用styl文件

完成

参考文献

Gemini向光性的博客