NexT 6.x 的_config.yml 文件可以配置 ICP 备案信息,但找不到公安备案设置入口,内置 custom_text 字段写入 html 标签总是报错,看来又是折腾的一天,自已动手丰衣足食。
尽量不要将变量写死在源码,应由配置文件控制
footer 区另起一行填写 ICP 备案和公安备案信息
改造对比
环境版本
Hexo: 3.8.0
NexT: 6.7.0
NexT 7.3 之后增加了公安备案配置项,但个人还是喜欢原来的展示方式,如果你也是 7.3.0 之后的版本,可以直接看最后的 [新版处理] 章节
修改配置
在主题目录下的 _config.yml 文件中找到 footer: 标签,加入配置字段
1 2 3 4 5 6 7 8 9 10 11
# Beian icp information for Chinese users. In China, every legal website should have a beian icp in website footer. # http://www.miitbeian.gov.cn beian: enable:true icp:粤ICP备18149642号-1
# 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前面的#删掉,启用自定义数据目录 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
# Beian ICP and gongan information for Chinese users. See: http://www.beian.miit.gov.cn, http://www.beian.gov.cn # 原版beian方式不好看,为避免修改footer.swig源文件,改名为beian_mod,交给数据文件下的footer.swig处理 beian_mod: enable:true icp:粤ICP备18149642号-1 # The digit in the num of gongan beian. gongan_id:44011202000693 # The full num of gongan beian. gongan_num:粤公网安备44011202000693号 # The icon for gongan beian. See: http://www.beian.gov.cn/portal/download gongan_icon_url:/images/beian.png