From 61d75c67b063f801ddde4a5a57d3c8f4a9e936d7 Mon Sep 17 00:00:00 2001 From: Vimiix Date: Thu, 1 Jun 2017 16:26:26 +0800 Subject: [PATCH] Add gitment module. (#260) --- _config.yml.example | 6 ++++++ layout/comment/gitment.ejs | 17 +++++++++++++++++ layout/comment/index.ejs | 2 ++ layout/comment/scripts.ejs | 2 ++ 4 files changed, 27 insertions(+) create mode 100644 layout/comment/gitment.ejs diff --git a/_config.yml.example b/_config.yml.example index b533c31..8e80cfe 100644 --- a/_config.yml.example +++ b/_config.yml.example @@ -58,6 +58,12 @@ comment: changyan: # please fill in `appid` and `conf` to enable appid: conf: + gitment: + owner: #your github ID + repo: #the repo to store comments + #Register an OAuth application, and you will get a client ID and a client secret. + client_id: #your client ID + client_secret: #your client secret # Share share: default # options: jiathis, bdshare, addtoany, default diff --git a/layout/comment/gitment.ejs b/layout/comment/gitment.ejs new file mode 100644 index 0000000..ce681e8 --- /dev/null +++ b/layout/comment/gitment.ejs @@ -0,0 +1,17 @@ +<% if (typeof(script) !== 'undefined' && script) { %> + + + + <% } else { %> +
+<% } %> \ No newline at end of file diff --git a/layout/comment/index.ejs b/layout/comment/index.ejs index 0389e83..2417800 100644 --- a/layout/comment/index.ejs +++ b/layout/comment/index.ejs @@ -12,6 +12,8 @@ <%- partial('comment/isso') %> <% } else if (theme.comment.changyan && theme.comment.changyan.appid && theme.comment.changyan.conf) { %> <%- partial('comment/changyan') %> + <% } else if (theme.comment.gitment) { %> + <%- partial('comment/gitment') %> <% } %> <% } %> \ No newline at end of file diff --git a/layout/comment/scripts.ejs b/layout/comment/scripts.ejs index f94ac39..54dde2e 100644 --- a/layout/comment/scripts.ejs +++ b/layout/comment/scripts.ejs @@ -10,4 +10,6 @@ <%- partial('comment/isso', { script: true }) %> <% } else if (theme.comment.changyan && theme.comment.changyan.appid && theme.comment.changyan.conf) { %> <%- partial('comment/changyan', { script: true }) %> +<% } else if (theme.comment.gitment.owner && theme.comment.gitment.repo && theme.comment.gitment.client_id && theme.comment.gitment.client_secret) { %> + <%- partial('comment/gitment', { script: true }) %> <% } %>