支持 Gridea 主题自定义

notion image
config.json 添加如下代码:
{"name": "jsdelivr","label": "jsDelivr 加速","group": "jsDelivr 加速配置","value": "false","type": "select", "options": [ {"label": "开启","value": true}, {"label": "关闭","value": false} ] }, {"name": "username","label": "Github 用户名","group": "jsDelivr 加速配置","value": "","type": "input","note": "请输入 Github 用户名"}, {"name": "repository","label": "Github 仓库名","group": "jsDelivr 加速配置","value": "","type": "input","note": "请输入 Github 仓库名"}
需要处,一般是 head.ejs 或 footer.ejs 按如下格式调整:
<% if ( site.customConfig.jsdelivr == true) { %> <script src="https://cdn.jsdelivr.net/gh/<%= site.customConfig.username %>/<%= site.customConfig.repository %>/media/js/jquery.min.js"></script> <% } else{ %> <script src="<%= themeConfig.domain %>/media/js/jquery.min.js"></script> <% }; %>
完工!
badge