diff --git a/README.md b/README.md index 05e42410..02c2eb39 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ --- -预览:[程序员小航](https://liuzhihang.com) +预览:[程序员小航](http://hao.liuzhihang.com/) 文档:[语雀](https://www.yuque.com/liuzhihangs/halo-theme-hao) diff --git a/package.json b/package.json index de72cd45..b1d99f61 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "halo-theme-hao", - "version": "1.0.0-beta.1", + "version": "1.0.0-beta.2", "dependencies": { } } diff --git a/settings.yaml b/settings.yaml index 6064a8b6..ab1d3d91 100644 --- a/settings.yaml +++ b/settings.yaml @@ -36,15 +36,6 @@ spec: - group: top label: 顶部 formSchema: - - $formkit: radio - name: recentTop - label: 首页顶部 - value: true - options: - - label: 显示 - value: true - - label: 隐藏 - value: false - $formkit: radio name: moment label: 说说模块 @@ -54,33 +45,103 @@ spec: value: true - label: 隐藏 value: false + - $formkit: radio + name: recentTop + id: recentTop + key: recentTop + label: 首页顶部 + value: true + options: + - label: 显示 + value: true + - label: 隐藏 + value: false - $formkit: text + if: "$get(recentTop).value" name: bannersTitleBig label: Banners 大标题 placeholder: 请输入大标题 + value: Halo Theme Hao help: 支持 HTML 语法 - $formkit: text + if: "$get(recentTop).value" name: bannersTitleSmall label: Banners 小标题 placeholder: 请输入小标题 + value: 更多信息请关注 GitHub help: 支持 HTML 语法 + - $formkit: repeater + if: "$get(recentTop).value" + name: bannersIconPair + label: Banner 滚动图标 + help: 为空时会使用系统内置图标 + value: + - top: + bottom: + children: + - $formkit: group + name: top + label: 上图标 + value: + url: + name: + background: + children: + - $formkit: url + name: url + label: 路径 + placeholder: 请输入图标路径 + validation: "url" + - $formkit: text + name: name + label: 名称 + placeholder: 请输入名称 + - $formkit: color + name: background + label: 背景色 + - $formkit: group + name: bottom + label: 下图标 + value: + url: + name: + background: + children: + - $formkit: url + name: url + label: 路径 + placeholder: 请输入图标路径 + validation: "url" + - $formkit: text + name: name + label: 名称 + placeholder: 请输入名称 + - $formkit: color + name: background + label: 背景色 - $formkit: url + if: "$get(recentTop).value" name: bikan label: 必看精选 placeholder: 请输入地址 validation: "url" - $formkit: url + if: "$get(recentTop).value" name: remen label: 必看精选 placeholder: 请输入地址 validation: "url" - $formkit: url + if: "$get(recentTop).value" name: shiyong label: 必看精选 placeholder: 请输入地址 validation: "url" - $formkit: radio + if: "$get(recentTop).value" name: todayRecommend + id: todayRecommend + key: todayRecommend label: 今日推荐 value: false options: @@ -88,21 +149,30 @@ spec: value: true - label: 隐藏 value: false - - $formkit: url - name: todayRecommendUrl - label: 今日推荐跳转地址 - placeholder: 请输入地址 - validation: "url" - - $formkit: text - name: todayRecommendTitle - label: 今日推荐标题 - placeholder: 请输入标题 - value: "今日推荐" - - $formkit: url - name: todayRecommendCover - label: 今日推荐背景图 - placeholder: 请输入地址 - validation: "url" + - $formkit: group + if: "$get(todayRecommend).value" + name: todayRecommendContent + label: 公众号 + value: + todayRecommendUrl: + todayRecommendTitle: + todayRecommendCover: + children: + - $formkit: url + name: todayRecommendUrl + label: 今日推荐跳转地址 + placeholder: 请输入地址 + validation: "url" + - $formkit: text + name: todayRecommendTitle + label: 今日推荐标题 + placeholder: 请输入标题 + value: "今日推荐" + - $formkit: url + name: todayRecommendCover + label: 今日推荐背景图 + placeholder: 请输入地址 + validation: "url" - group: layout label: 布局 @@ -155,42 +225,6 @@ spec: label: "右侧" - value: "left-aside" label: "左侧" - -# - $formkit: repeater -# name: widgets -# label: 小部件 -# value: -# - value: profile -# - value: wechat -# - value: comments -# - value: recent-posts -# - value: comments -# - value: categories -# - value: tags -# - value: stat -# - value: tags-stat -# children: -# - $formkit: select -# name: value -# label: 部件 -# options: -# - label: 站点资料 -# value: profile -# - label: 微信 -# value: wechat -# - label: 近期文章 -# value: recent-posts -# - label: 最新评论 -# value: comments -# - label: 文章分类 -# value: categories -# - label: 文章标签 -# value: tags -# - label: 统计 -# value: stat -# - label: 标签&统计 -# value: tags-stat - - $formkit: textarea name: widgets label: 小部件 diff --git a/templates/assets/js/heo.js b/templates/assets/js/heo.js index b1ca62d1..831c015c 100644 --- a/templates/assets/js/heo.js +++ b/templates/assets/js/heo.js @@ -89,57 +89,57 @@ var heo = { // 标签页面 //分类条 - tagPageActive: function () { - var urlinfo = window.location.pathname; - urlinfo = decodeURIComponent(urlinfo) - // console.log(urlinfo); - // 验证是否是分类链接 - var pattern = /\/tags\/.*?\//; - var patbool = pattern.test(urlinfo); - // console.log(patbool); - // 获取当前的分类 - if (patbool) { - var valuegroup = urlinfo.split("/"); - // console.log(valuegroup[2]); - // 获取当前分类 - var nowCategorie = valuegroup[2]; - if (document.querySelector('#tag-page-tags')) { - $('a').removeClass('select') - document.getElementById(nowCategorie).classList.add("select"); - } - } - }, + // tagPageActive: function () { + // var urlinfo = window.location.pathname; + // urlinfo = decodeURIComponent(urlinfo) + // // console.log(urlinfo); + // // 验证是否是分类链接 + // var pattern = /\/tags\/.*?\//; + // var patbool = pattern.test(urlinfo); + // // console.log(patbool); + // // 获取当前的分类 + // if (patbool) { + // var valuegroup = urlinfo.split("/"); + // // console.log(valuegroup[2]); + // // 获取当前分类 + // var nowCategorie = valuegroup[2]; + // if (document.querySelector('#tag-page-tags')) { + // $('a').removeClass('select') + // document.getElementById(nowCategorie).classList.add("select"); + // } + // } + // }, //分类条 - categoriesBarActive: function () { - if (document.querySelector('#category-bar')) { - $(".category-bar-item").removeClass("select") - } - var urlinfo = window.location.pathname; - urlinfo = decodeURIComponent(urlinfo); - // console.log(urlinfo); - //判断是否是首页 - if (urlinfo == '/') { - if (document.querySelector('#category-bar')) { - document.getElementById('category-bar-home').classList.add("select"); - } - } else { - // 验证是否是分类链接 - var pattern = /\/categories\/.*?\//; - var patbool = pattern.test(urlinfo); - // console.log(patbool); - // 获取当前的分类 - if (patbool) { - var valuegroup = urlinfo.split("/"); - // console.log(valuegroup[2]); - // 获取当前分类 - var nowCategorie = valuegroup[2]; - if (document.querySelector('#category-bar')) { - document.getElementById(nowCategorie).classList.add("select"); - } - } - } - }, + // categoriesBarActive: function () { + // if (document.querySelector('#category-bar')) { + // $(".category-bar-item").removeClass("select") + // } + // var urlinfo = window.location.pathname; + // urlinfo = decodeURIComponent(urlinfo); + // // console.log(urlinfo); + // //判断是否是首页 + // if (urlinfo == '/') { + // if (document.querySelector('#category-bar')) { + // document.getElementById('category-bar-home').classList.add("select"); + // } + // } else { + // // 验证是否是分类链接 + // var pattern = /\/categories\/.*?\//; + // var patbool = pattern.test(urlinfo); + // // console.log(patbool); + // // 获取当前的分类 + // if (patbool) { + // var valuegroup = urlinfo.split("/"); + // // console.log(valuegroup[2]); + // // 获取当前分类 + // var nowCategorie = valuegroup[2]; + // if (document.querySelector('#category-bar')) { + // document.getElementById(nowCategorie).classList.add("select"); + // } + // } + // } + // }, // 页脚友链 addFriendLinksInFooter: function () { diff --git a/templates/assets/zhheo/blogex.js b/templates/assets/zhheo/blogex.js index 477fcbbd..173656ba 100644 --- a/templates/assets/zhheo/blogex.js +++ b/templates/assets/zhheo/blogex.js @@ -779,10 +779,10 @@ document.addEventListener('load', function () { heo.reflashEssayWaterFall() heo.addMediumInEssay() heo.darkModeStatus() - heo.categoriesBarActive() + // heo.categoriesBarActive() heo.initThemeColor() heo.hideLoading() - heo.tagPageActive() + // heo.tagPageActive() }) window.onscroll = function () { percent(); diff --git a/templates/category.html b/templates/category.html index 1d9c2a9d..f6fac7c4 100644 --- a/templates/category.html +++ b/templates/category.html @@ -17,7 +17,7 @@ 首页
- +