Closed chiperman closed 4 years ago
有复现的主题链接发一下吗?理论上应该没问题的, 默认主题也有 switch 选项,可以对比着看一下,配置之后理论上会在 博客源原文件夹(默认是 Documents/Gridea)/config/theme.json
里面有相关的实际配置值
https://github.com/getgridea/gridea-theme-notes/blob/master/config.json
主题地址 Pan 里面的自定义配置-开启建站时间switch控件,实际上我试了一下是否开启 Valine 评论按钮也遇到这个问题。
预览后,可以在底部看见 「我」已经运行xxx天
这个footer 信息
然后去自定义配置中关闭按钮,保存并且重新打开,会发现按钮重新显示开启,但实际上,这个时候预览会发现「我」已经运行xxx天
这个footer 信息已经不在了,但是自定义配置中显示有问题
补充信息:在style-override.js
中
进行了显示判断
if (typeof params.buildTimeLaunch !== 'undefined' && !params.buildTimeLaunch) {
result += `
.runtime {
display: none;
}
`
}
已经解决,json 中不要写 "value": true
这个默认值,否则每次打开都会显示为开启状态
{
"name": "buildTimeLaunch",
"label": "是否需要开启博客建站时间",
"group": "建站时间",
"value": true,
"type": "switch",
"note": "开启则在 footer.js 中运行博客建立时间插件"
},
我的环境
期望行为
自定义了json文件后,不管怎么选,下次打开还是默认值
当前行为
设置一个
"type": "switch"
以后,如果默认"value": true,
,那么进去以后选项按钮是打开的 可是,假设我关闭这个按钮以后并保存,然后重新打开 Gridea,进入这个自定义配置里面,这个选项还是表现为开启状态,实际上是已经关掉了,我认为是保存以后,没有自动修改 json 文件里面的 value 值。