From fc25055569cf395234fd9a42f85d89b939b0097c Mon Sep 17 00:00:00 2001 From: muxiaobai Date: Fri, 18 May 2018 10:48:25 +0800 Subject: [PATCH 1/2] gitment --- _config.yml | 14 ++++++++++++++ layout/_partial/article.ejs | 9 ++++++++- layout/_partial/comments/gitment.ejs | 17 +++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 layout/_partial/comments/gitment.ejs diff --git a/_config.yml b/_config.yml index 81b34f375..65db8bbab 100644 --- a/_config.yml +++ b/_config.yml @@ -89,6 +89,20 @@ show_count: false ## 是否在主页文章标题旁显示评论数(多说、Disqus) ## Add comment count after article title + + +gitment: + #on: true + gitment_GitHub_id: your github username + gitment_repo: your github repo + gitment_client_id: XXXXX + gitment_client_secret: XXXXXXXX + # use gitment issue + # this comments only use github ,and push github 'gitment_repo' + # if use gitment this the four params should have content. + # you can get gitment_client_id and gitment_client_secret through https://github.com/settings/applications/new + # + disqus: #on: true shortname: diff --git a/layout/_partial/article.ejs b/layout/_partial/article.ejs index e5b992a4e..b40831388 100644 --- a/layout/_partial/article.ejs +++ b/layout/_partial/article.ejs @@ -63,7 +63,14 @@ <% } %> <% if (!index && post.comments){ %> - <% if (theme.duoshuo.on) { %> + + <% if (theme.gitment.on) { %> + <%- partial('comments/gitment', { + key: post.path, + title: post.title, + url: config.url+url_for(post.path), + }) %> + <% } else if (theme.duoshuo.on) { %> <%- partial('comments/duoshuo', { key: post.path, title: post.title, diff --git a/layout/_partial/comments/gitment.ejs b/layout/_partial/comments/gitment.ejs new file mode 100644 index 000000000..26b2449f1 --- /dev/null +++ b/layout/_partial/comments/gitment.ejs @@ -0,0 +1,17 @@ +
+
+ + + +
\ No newline at end of file From 84e3d35c749ff43e18a3602b8b2e790bd31f84a1 Mon Sep 17 00:00:00 2001 From: muxiaobai Date: Fri, 18 May 2018 11:10:37 +0800 Subject: [PATCH 2/2] gitment --- layout/_partial/comments/gitment.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layout/_partial/comments/gitment.ejs b/layout/_partial/comments/gitment.ejs index 26b2449f1..102c12f69 100644 --- a/layout/_partial/comments/gitment.ejs +++ b/layout/_partial/comments/gitment.ejs @@ -1,5 +1,5 @@
-
+