diff --git a/templates/assets/js/custom.js b/templates/assets/js/custom.js
index 84956cbf..53cb9972 100644
--- a/templates/assets/js/custom.js
+++ b/templates/assets/js/custom.js
@@ -428,6 +428,96 @@ document.addEventListener("DOMContentLoaded", () => {
}
);
+
+ // flink 友链标签
+ customElements.define(
+ "hao-flink",
+ class HaoGalleryGroup extends HTMLElement {
+ constructor() {
+ super();
+ this.options = {
+ name: this.getAttribute("name"),
+ desc: this.getAttribute("desc"),
+ style: this.getAttribute("style"),
+ };
+ const _temp = getChildren(this, "_tpl");
+ let _innerHTML = _temp.innerHTML.trim().replace(/^(
)|(
)$/g, "");
+ let style = this.options.style;
+ let content = "";
+ let contents = "";
+ let class_desc = "";
+ _innerHTML.replace(
+ /{([^}]*)}/g,
+ function ($0, $1) {
+ var flink = $1.split(",",5);
+ if(style=='beautify'){
+ contents +=`
+
+
${this.options.name}
+ ${class_desc}
+ ${content}
+
+ `;
+ this.innerHTML = htmlStr;
+ }
+ }
+ );
+
+
customElements.define(
"hao-dplayer",
class HaoDplayer extends HTMLElement {
diff --git a/templates/assets/js/main.js b/templates/assets/js/main.js
index 39aed8b7..fd42b62e 100644
--- a/templates/assets/js/main.js
+++ b/templates/assets/js/main.js
@@ -147,6 +147,29 @@ document.addEventListener('DOMContentLoaded', function () {
}
}
+ /**
+ * toc
+ */
+ const tocFn = function () {
+ const postContent = document.querySelector('.post-content');
+
+ if (postContent == null) return;
+
+ const headers = postContent.querySelectorAll('h1,h2,h3,h4,h5,h6');
+ // 没有 toc 目录,则直接移除
+ if (headers.length === 0) {
+ document.getElementById("card-toc").remove();
+ } else {
+ tocbot.init({
+ tocSelector: '.toc-content',
+ contentSelector: '.post-content',
+ headingSelector: 'h1,h2,h3,h4,h5,h6',
+ hasInnerContainers: true
+ });
+
+ }
+ }
+
/**
* 滾動處理
*/
@@ -446,6 +469,7 @@ document.addEventListener('DOMContentLoaded', function () {
if (GLOBAL_CONFIG.isPost) {
addRuntime();
+ tocFn();
} else {
addLastPushDate()
toggleCardCategory()
diff --git a/templates/assets/zhheo/blogex.js b/templates/assets/zhheo/blogex.js
index f61e78c8..b23d7675 100644
--- a/templates/assets/zhheo/blogex.js
+++ b/templates/assets/zhheo/blogex.js
@@ -452,13 +452,6 @@ function removeLoading() {
}, 3000)
}
-//移除pwa
-navigator.serviceWorker.getRegistrations().then(function (registrations) {
- for (let registration of registrations) {
- registration.unregister()
- }
-})
-
function addFriendLink() {
var input = document.getElementsByClassName('el-textarea__inner')[0];
let evt = document.createEvent('HTMLEvents');
@@ -672,7 +665,6 @@ function initBlog() {
//隐藏加载动画
GLOBAL_CONFIG.loadingBox && heo.hideLoading(),
checkUrlAndAddHideBanner()
-
}
// 如果当前页有评论就执行函数
diff --git a/templates/assets/zhheo/custom.css b/templates/assets/zhheo/custom.css
index 81c69319..1a8760eb 100644
--- a/templates/assets/zhheo/custom.css
+++ b/templates/assets/zhheo/custom.css
@@ -2102,4 +2102,13 @@ p.p.purple,span.p.purple {
p.p.gray,span.p.gray {
color: #999
+}
+
+.flink-name {
+ margin-bottom: 5px;
+ font-weight: 700;
+ font-size: 1.5em
+}
+.flink-desc {
+ margin: .2rem 0 .5rem
}
\ No newline at end of file
diff --git a/templates/modules/common/toc-bot.html b/templates/modules/common/toc-bot.html
index d961bd06..6e925230 100644
--- a/templates/modules/common/toc-bot.html
+++ b/templates/modules/common/toc-bot.html
@@ -4,51 +4,5 @@