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 @@
- # [[${tag.spec.displayName}]] - + th:classappend="${tag.metadata.name == tagItem.metadata.name} ? 'select'" + th:each="tagItem : ${tags}" + th:href="@{${tagItem.status.permalink}}" + th:id="${tagItem.spec.displayName}"> + # [[${tagItem.spec.displayName}]] +