Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
大白技术控
yanglr2010
提交
559fab51
Y
yanglr2010
项目概览
大白技术控
/
yanglr2010
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
yanglr2010
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
559fab51
编写于
12月 04, 2019
作者:
EvanOne(文一)
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: Add support for utterances comments
上级
49b02321
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
53 addition
and
1 deletion
+53
-1
_config.yml
_config.yml
+22
-0
layout/_partials/widgets/comments.pug
layout/_partials/widgets/comments.pug
+3
-0
layout/_third-party/comments/index.pug
layout/_third-party/comments/index.pug
+2
-0
layout/_third-party/comments/utterances.pug
layout/_third-party/comments/utterances.pug
+25
-0
source/css/_common/components/widgets/comments.styl
source/css/_common/components/widgets/comments.styl
+1
-1
未找到文件。
_config.yml
浏览文件 @
559fab51
...
@@ -444,6 +444,28 @@ disqus:
...
@@ -444,6 +444,28 @@ disqus:
shortname
:
shortname
:
count
:
true
count
:
true
# Utterances
# See: https://utteranc.es/
utterances
:
enable
:
false
# Github username.
owner
:
# Github repository.
repo
:
# Choose the mapping between blog posts and GitHub issues.
# Available values: pathname | url | title | og:title
mapping
:
pathname
# Choose the label that will be assigned to issues created by Utterances.
# Emoji are supported in label names.
label
:
utterances
# Choose an Utterances theme that matches your blog.
# Available values: github-light | github-dark | github-dark-orange | icy-dark | dark-blue | photon-dark
theme
:
github-light
# ! -------------------------------------------------------------------------------
# ! Don't set this unless the URL of the script in the official website is changed.
# ! -------------------------------------------------------------------------------
script_url
:
https://utteranc.es/client.js
# ---------------------------------------------------------------
# ---------------------------------------------------------------
# Statistics and Analytics config
# Statistics and Analytics config
# ---------------------------------------------------------------
# ---------------------------------------------------------------
...
...
layout/_partials/widgets/comments.pug
浏览文件 @
559fab51
...
@@ -7,6 +7,9 @@ else if theme.valine && theme.valine.enable
...
@@ -7,6 +7,9 @@ else if theme.valine && theme.valine.enable
else if theme.gitalk && theme.gitalk.enable
else if theme.gitalk && theme.gitalk.enable
div#comments.comments
div#comments.comments
div#gitalk-container
div#gitalk-container
else if theme.utterances && theme.utterances.enable
div#comments.comments
div#utterances-container
else if theme.livere && theme.livere.enable
else if theme.livere && theme.livere.enable
div#comments.comments
div#comments.comments
div#lv-container(data-id="city" data-uid=theme.livere.uid)
div#lv-container(data-id="city" data-uid=theme.livere.uid)
layout/_third-party/comments/index.pug
浏览文件 @
559fab51
...
@@ -5,6 +5,8 @@ if page.comments || theme.pjax.enable
...
@@ -5,6 +5,8 @@ if page.comments || theme.pjax.enable
include ./valine.pug
include ./valine.pug
else if theme.gitalk && theme.gitalk.enable
else if theme.gitalk && theme.gitalk.enable
include ./gitalk.pug
include ./gitalk.pug
else if theme.utterances && theme.utterances.enable
include ./utterances.pug
else if theme.livere && theme.livere.enable
else if theme.livere && theme.livere.enable
include ./livere.pug
include ./livere.pug
else if theme.valine && theme.valine.enable && theme.valine.visitor
else if theme.valine && theme.valine.enable && theme.valine.visitor
...
...
layout/_third-party/comments/utterances.pug
0 → 100644
浏览文件 @
559fab51
script&attributes(dataPjax).
function loadUtterances() {
var d = document, s = d.createElement('script');
var container = d.getElementById('utterances-container');
if (!container) return;
s.src = '!{ theme.utterances.script_url }';
s.setAttribute('repo', '!{ theme.utterances.owner }/!{ theme.utterances.repo }');
s.setAttribute('issue-term', '!{ theme.utterances.mapping }');
s.setAttribute('label', '!{ theme.utterances.label }');
s.setAttribute('theme', '!{ theme.utterances.theme }');
s.setAttribute('crossorigin', 'anonymous');
s.setAttribute('async', '');
if (!{ pjax }) { s.setAttribute('data-pjax-rm', ''); }
container.append(s);
}
if (!{ pjax }) {
loadUtterances();
} else {
window.addEventListener('DOMContentLoaded', loadUtterances, false);
}
source/css/_common/components/widgets/comments.styl
浏览文件 @
559fab51
if (hexo-config('gitalk.enable') || hexo-config('valine.enable') || hexo-config('livere.enable') || hexo-config('disqus.enable')) {
if (hexo-config('gitalk.enable') || hexo-config('valine.enable') || hexo-config('livere.enable') || hexo-config('disqus.enable')
|| hexo-config('utterances.enable')
) {
.comments {
.comments {
margin: 1.5rem 0 0;
margin: 1.5rem 0 0;
width: 100%;
width: 100%;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录