diff --git a/README.md b/README.md index 3a559d02..521f70ed 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,9 @@

- Halo version + Halo version - size + size LICENSE

@@ -40,23 +40,23 @@ | 小孙同学 | https://blog.sunguoqi.com | | 流殃 | https://shyblog.world | | 羡羡 | https://www.hydsb0.com/ | -| 困困鱼 | https://0206.ink | +| 困困鱼 | https://kunkunyu.com | | Top John | https://op-lab.top | | Roozen | https://roozen.top | | Lanbin | https://lib.lanbin.top | ## 👋 简介 -[Halo-Theme-Hao](https://github.com/liuzhihang/halo-theme-hao) 是一款适用于 [Halo2.x](https://github.com/halo-dev/halo) 的博客主题。 +[Halo-Theme-Hao](https://githubfast.com/liuzhihang/halo-theme-hao) 是一款适用于 [Halo2.x](https://githubfast.com/halo-dev/halo) 的博客主题。 移植自 [Hexo](https://hexo.io/zh-cn/index.html) 社区中 [张洪 Heo](https://blog.zhheo.com/) -对 [Hexo-Theme-Butterfly](https://github.com/liuzhihang/halo-theme-hao) +对 [Hexo-Theme-Butterfly](https://githubfast.com/liuzhihang/halo-theme-hao) 主题的魔改版本。 ## 🚨 注意事项(看我看我) 1. **建站时间必填** -2. 如果安装主题后报错,请仔细查阅[主题说明](https://github.com/liuzhihang/halo-theme-hao)与[更新说明](https://github.com/liuzhihang/halo-theme-hao/releases)!!! +2. 如果安装主题后报错,请仔细查阅[主题说明](https://githubfast.com/liuzhihang/halo-theme-hao)与[更新说明](https://githubfast.com/liuzhihang/halo-theme-hao/releases)!!! 3. 如果还未解决,可以加群求助!!! 4. 如果群友也解决不了,再考虑提ISSUE!!! 5. `1.3.1`及以上版本需要`Halo`版本>=`2.8.0` @@ -74,7 +74,7 @@ #### 🚂 本地安装 -1. 在 [ Release](https://github.com/liuzhihang/halo-theme-hao/releases) 页面 `下载` 最新主题包 (zip) +1. 在 [ Release](https://githubfast.com/liuzhihang/halo-theme-hao/releases) 页面 `下载` 最新主题包 (zip) 2. 进入 Halo 后台 -> 主题 (左侧面板) 3. 点击右上角 “主题”, 在弹出的窗口中选择 `安装主题` 4. 选择下载好的主题包(zip) @@ -82,7 +82,7 @@ #### 🛸 远程安装 -1. 复制地址 `https://github.com/liuzhihang/halo-theme-hao` +1. 复制地址 `https://githubfast.com/liuzhihang/halo-theme-hao` 2. 进入Halo后台 -> 外观 -> 主题 (左侧面板) 3. 点击右上方 `安装` 按钮, 然后选择 `远程下载` 4. 在文本框中粘贴仓库地址后点击下载 @@ -92,16 +92,16 @@ > 部分插件可能已经预设在 Halo 内。 > 部分插件主题尚未适配。 -- 评论功能 [plugin-comment-widget](https://github.com/halo-sigs/plugin-comment-widget/releases) -- 搜索功能 [plugin-search-widget](https://github.com/halo-sigs/plugin-search-widget/releases) -- 友链页面 [plugin-links](https://github.com/halo-sigs/plugin-links) -- 瞬间页面 [plugin-moments](https://github.com/halo-sigs/plugin-moments) -- 代码高亮 [plugin-prismjs](https://github.com/liuzhihang/plugin-prismjs) -- 追番插件 [plugin-bilibili-bangumi](https://github.com/Roozenlz/plugin-bilibili-bangumi) -- 图库插件 [plugin-photos](https://github.com/halo-sigs/plugin-photos) -- 主题标签 [plugin-haotag](https://github.com/chengzhongxue/plugin-haotag) +- 评论功能 [plugin-comment-widget](https://githubfast.com/halo-sigs/plugin-comment-widget/releases) +- 搜索功能 [plugin-search-widget](https://githubfast.com/halo-sigs/plugin-search-widget/releases) +- 友链页面 [plugin-links](https://githubfast.com/halo-sigs/plugin-links) +- 瞬间页面 [plugin-moments](https://githubfast.com/halo-sigs/plugin-moments) +- 代码高亮 [plugin-prismjs](https://githubfast.com/liuzhihang/plugin-prismjs) +- 追番插件 [plugin-bilibili-bangumi](https://githubfast.com/Roozenlz/plugin-bilibili-bangumi) +- 图库插件 [plugin-photos](https://githubfast.com/halo-sigs/plugin-photos) +- 主题标签 [plugin-haotag](https://githubfast.com/chengzhongxue/plugin-haotag) -> 更多插件请参见:https://github.com/halo-sigs/awesome-halo +> 更多插件请参见:https://githubfast.com/halo-sigs/awesome-halo ## 📝 使用 @@ -109,7 +109,7 @@ ## 🔐 许可 -[Halo-Theme-Hao](https://github.com/liuzhihang/halo-theme-hao) 使用 [GPL-v3.0](./LICENSE) 协议开源,请遵守开源协议。 +[Halo-Theme-Hao](https://githubfast.com/liuzhihang/halo-theme-hao) 使用 [GPL-v3.0](./LICENSE) 协议开源,请遵守开源协议。 ## 💬 讨论 @@ -129,7 +129,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)) :) -This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! +This project follows the [all-contributors](https://githubfast.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! [![All Contributors](https://img.shields.io/badge/all_contributors-14-orange.svg?style=flat-square)](#contributors-) @@ -141,30 +141,30 @@ This project follows the [all-contributors](https://github.com/all-contributors/ - - - - - - + + + + + + - - - - - - + + + + + + - - + + diff --git a/templates/assets/js/halo.js b/templates/assets/js/halo.js index 2ea13c1e..b93e840f 100644 --- a/templates/assets/js/halo.js +++ b/templates/assets/js/halo.js @@ -270,9 +270,6 @@ let halo = { e.batchSend(t, !0); else { let n = []; - function a(e) { - return e = (e = (e = (e = (e = e.replace(/<\/*br>|[\s\uFEFF\xA0]+/g, "")).replace(//g, "[图片]")).replace(/.*?<\/a>/g, "[链接]")).replace(/.*?<\/pre>/g, "[代码块]")).replace(/<.*?>/g, "") - } if(GLOBAL_CONFIG.source.comments.use == 'Twikoo'){ fetch(GLOBAL_CONFIG.source.twikoo.twikooUrl, { method: "POST", @@ -290,7 +287,7 @@ let halo = { null == e.avatar && (e.avatar = "https://cravatar.cn/avatar/d615d5793929e8c7d70eab5f00f7f5f1?d=mp"), n.push({ avatar: e.avatar, - content: e.nick + ":" + a(e.comment), + content: e.nick + ":" + btf.changeContent(e.comment), href: e.url + '#' + e.id }) @@ -319,7 +316,7 @@ let halo = { t.forEach((e=>{ n.push({ avatar: 'https://cravatar.cn/avatar/' + e.email_encrypted + '?d=mp&s=240', - content: e.nick + ":" + a(e.content_marked), + content: e.nick + ":" + btf.changeContent(e.content_marked), href: e.page_url + '#atk-comment-' + e.id }) @@ -338,7 +335,7 @@ let halo = { }).then(({ comments }) => { const walineArray = comments.map(e => { return { - 'content': e.nick + ":" + a(e.comment), + 'content': e.nick + ":" + btf.changeContent(e.comment), 'avatar': e.avatar, 'href': e.url + '#' + e.objectId, } diff --git a/templates/assets/js/heo.js b/templates/assets/js/heo.js index 887b8fdd..0edeeeea 100644 --- a/templates/assets/js/heo.js +++ b/templates/assets/js/heo.js @@ -22,6 +22,12 @@ var heo = { // 首页bb initIndexEssay: function() { if (document.querySelector("#bber-talk")) + $(".swiper-wrapper .swiper-slide").each(function () { + var text = $(this)[0].innerText; + if (text != 'undefined') { + $(this).text(btf.changeContent(text)); + } + }) new Swiper(".swiper-container",{ direction: "vertical", loop: !0, diff --git a/templates/assets/js/utils.js b/templates/assets/js/utils.js index b2356358..4c4de61e 100644 --- a/templates/assets/js/utils.js +++ b/templates/assets/js/utils.js @@ -331,6 +331,23 @@ var btf = { } return actualTop + }, + //过滤标签 + changeContent: (content,length = null)=>{ + if (content === '') return content + + content = content.replace(/]+>/ig, '[图片]') // replace image link + content = content.replace(/]+?href=["']?([^"']+)["']?[^>]*>([^<]+)<\/a>/gi, '[链接]') // replace url + content = content.replace(/
.*?<\/pre>/gi, '[代码]') // replace code
+        content = content.replace(/<[^>]+>/g, "") // remove html tag
+
+        if (length!=null){
+            if (content.length > length) {
+                content = content.substring(0, length) + '...'
+            }
+        }
+
+        return content
     }
 
 }
diff --git a/templates/modules/comment/Artalk.html b/templates/modules/comment/Artalk.html
index 66d704bc..db982857 100644
--- a/templates/modules/comment/Artalk.html
+++ b/templates/modules/comment/Artalk.html
@@ -10,19 +10,6 @@
     
     
 
-    
-
     
 
     
diff --git a/templates/modules/layouts/layout.html b/templates/modules/layouts/layout.html
index db6df69e..964132f7 100644
--- a/templates/modules/layouts/layout.html
+++ b/templates/modules/layouts/layout.html
@@ -56,6 +56,7 @@
 
 
+
liuzhihang
liuzhihang

💻
sunheyi
sunheyi

💻
Joy
Joy

💻
John Niang
John Niang

💻
Lanbin
Lanbin

小孙同学
小孙同学

💻
liuzhihang
liuzhihang

💻
sunheyi
sunheyi

💻
Joy
Joy

💻
John Niang
John Niang

💻
Lanbin
Lanbin

小孙同学
小孙同学

💻
airbo
airbo

💻
Gadore
Gadore

💻
羡羡
羡羡

💻
困困鱼
困困鱼

💻
Top John
Top John

💻
BugJi
BugJi

💻
airbo
airbo

💻
Gadore
Gadore

💻
羡羡
羡羡

💻
困困鱼
困困鱼

💻
Top John
Top John

💻
BugJi
BugJi

💻
Roozen
Roozen

💻
石头君
石头君

💻
Roozen
Roozen

💻
石头君
石头君

💻
- + Add your contributions