Skip to content

Commit

Permalink
refactor: 删除git系评论系统
Browse files Browse the repository at this point in the history
  • Loading branch information
zkz098 committed Dec 29, 2023
1 parent 185f0fc commit b82f639
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 62 deletions.
23 changes: 0 additions & 23 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,29 +183,6 @@ waline:
pageSize: 10 # 每页评论条数
pageview: false # 是否开启浏览量统计,可独立开启

# https://github.com/gitalk/gitalk/blob/master/readme-cn.md
gitalk:
clientID:
clientSecret:
repo:
owner:
admin:
proxy: # 选填

# https://giscus.app/zh-CN
giscus:
repo:
repoId:
category:
categoryId:
mapping:
strict:
reactionsEnabled:
emitMetadata:
inputPosition:
commentTheme:
lang:

summary:
enable: false
introduce: "我是基于ChatGPT-turbo-3.5实现的AI助手,在此网站上负责整理和概括文章" # AI自我介绍
Expand Down
35 changes: 1 addition & 34 deletions layout/_mixin/comment.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
mixin CommentRender()
!= shokax_inject('comment')
- var tk = theme?.twikoo?.enable,wl = theme?.waline?.enable,gt=theme?.gitalk?.enable,gs=theme?.giscus?.enable
- var tk = theme?.twikoo?.enable,wl = theme?.waline?.enable
if page.comment !== false && !theme.experiments.disableThemeComment
if tk
div(class="wrap" id="tcomments")
Expand Down Expand Up @@ -37,38 +37,5 @@ mixin CommentRender()
dark: 'html[data-theme="dark"]'
});
}, 1000)
else if gt
div(class="wrap" id="gtcomments")
script(type="text/javascript" data-pjax).
const gproxy = theme.gitalk.proxy || undefined
const gitalk = new Gitalk({
clientID: '#{theme.gitalk.clientID}',
clientSecret: '#{theme.gitalk.clientSecret}',
repo: '#{theme.gitalk.repo}',
owner: '#{theme.gitalk.owner}',
admin: #{theme.gitalk.admin},
id: location.pathname, // Ensure uniqueness and length less than 50
distractionFreeMode: false, // Facebook-like distraction free mode
proxy: "#{gproxy}"
});
gitalk.render("gtcomments")
else if gs
div(class="wrap giscus" id="gscomments")
script( src="https://giscus.app/client.js"
data-repo="#{theme.giscus.repo}"
data-repo-id="#{theme.giscus.repoId}"
data-category="#{theme.giscus.category}"
data-category-id="#{theme.giscus.categoryId}"
data-mapping="#{theme.giscus.mapping}"
data-strict="#{theme.giscus.strict}"
data-reactions-enabled="#{theme.giscus.reactionsEnabled}"
data-emit-metadata="#{theme.giscus.emitMetadata}"
data-input-position="#{theme.giscus.inputPosition}"
data-theme="#{theme.giscus.commentTheme}"
data-lang="#{theme.giscus.lang}"
data-loading="lazy"
crossorigin="anonymous"
async
)
5 changes: 1 addition & 4 deletions layout/_partials/head/head.pug
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- var siteTitle = config.title,noBaiduT = theme?.seo?.disable_baidu_transformation
- var feedLink = full_url_for("/feed.json")
- var tk= theme?.twikoo?.enable
- var wl = theme.waline.enable,gt=theme?.gitalk?.enable
- var wl = theme.waline.enable
meta(charset="UTF-8")
meta(name="viewport" content="width=device-width,initial-scale=1,maximum-scale=2")
meta(name="theme-color" content="#222")
Expand Down Expand Up @@ -54,9 +54,6 @@ if tk
script(src=theme.twikoo.link)
else if wl
link(rel="stylesheet" href="https://unpkg.com/@waline/client@v2/dist/waline.css")
else if gt
link(rel="stylesheet" href="https://unpkg.com/gitalk/dist/gitalk.css")
script(src="https://unpkg.com/gitalk/dist/gitalk.min.js")
- var qw = theme?.qweather?.enable
if qw
Expand Down
2 changes: 1 addition & 1 deletion scripts/plugin/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Some features will be disabled or render incorrectly`)
hexo.log.warn('[SXEC 201] Essential information(title, desc, lang, etc) config incorrectly, Page will render incorrectly')
}
if (hexo.theme.config.gitalk.clientID || hexo.theme.config.giscus.repo) {
hexo.log.info('You are using an untested feature and there may be undiscovered issues')
hexo.log.warn('You are using an deprecated feature and it was removed in the v0.3.10')
}
})

Expand Down

0 comments on commit b82f639

Please sign in to comment.