From f7ce8780bd0e4ad3f6a5ddd84a8e2a55c85aaad9 Mon Sep 17 00:00:00 2001 From: liuzhihang Date: Sat, 19 Nov 2022 19:35:43 +0800 Subject: [PATCH 1/6] =?UTF-8?q?banner-group.html=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- settings.yaml | 114 ++++++++++++-------- templates/modules/widgets/banner-group.html | 14 ++- 3 files changed, 83 insertions(+), 47 deletions(-) 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/settings.yaml b/settings.yaml index 6064a8b6..14ab598d 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,32 +45,98 @@ 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: 请输入大标题 help: 支持 HTML 语法 - $formkit: text + if: "$get(recentTop).value" name: bannersTitleSmall label: Banners 小标题 placeholder: 请输入小标题 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 label: 今日推荐 value: false @@ -89,16 +146,19 @@ spec: - label: 隐藏 value: false - $formkit: url + if: "$get(recentTop).value" name: todayRecommendUrl label: 今日推荐跳转地址 placeholder: 请输入地址 validation: "url" - $formkit: text + if: "$get(recentTop).value" name: todayRecommendTitle label: 今日推荐标题 placeholder: 请输入标题 value: "今日推荐" - $formkit: url + if: "$get(recentTop).value" name: todayRecommendCover label: 今日推荐背景图 placeholder: 请输入地址 @@ -155,42 +215,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/modules/widgets/banner-group.html b/templates/modules/widgets/banner-group.html index 62efa56a..c50e37b1 100644 --- a/templates/modules/widgets/banner-group.html +++ b/templates/modules/widgets/banner-group.html @@ -15,7 +15,7 @@
-
+
@@ -129,6 +129,18 @@
+
+
+
+ +
+
+ +
+
+
Date: Sat, 19 Nov 2022 20:37:33 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E9=A1=B5=E5=92=8C=E5=88=86=E7=B1=BB=E9=A1=B5=E9=AB=98=E4=BA=AE?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/assets/js/heo.js | 98 +++++++++++++-------------- templates/assets/zhheo/blogex.js | 4 +- templates/modules/layouts/layout.html | 2 +- templates/tag.html | 11 +-- 4 files changed, 58 insertions(+), 57 deletions(-) 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/modules/layouts/layout.html b/templates/modules/layouts/layout.html index 379608bd..ab34a95c 100644 --- a/templates/modules/layouts/layout.html +++ b/templates/modules/layouts/layout.html @@ -110,7 +110,7 @@ heo.reflashEssayWaterFall(); heo.addMediumInEssay(); heo.darkModeStatus(); - heo.categoriesBarActive(); + // heo.categoriesBarActive(); heo.initThemeColor(); diff --git a/templates/tag.html b/templates/tag.html index a87659f4..e4c33bf6 100644 --- a/templates/tag.html +++ b/templates/tag.html @@ -11,11 +11,12 @@