diff --git a/_config.yml b/_config.yml index f57c58bd27..72a2f5c0fa 100755 --- a/_config.yml +++ b/_config.yml @@ -389,6 +389,19 @@ valine: # You can get your uid from https://livere.com/insight/myCode (General web site) #livere_uid: your uid +# Gitalk comment support. +# Before using this you need to create a GitHub OAuth applicant. +# See https://github.com/gitalk/gitalk. +gitalk: + enable: false + clientID: + clientSecret: + repo: # Your repo name. + owner: # Your username. + admin: # Your username and other admins' username, support multiple admins split with comma, e.g. foo,bar. + pagerDirection: first # Start with the first comment. + + # Gitment # Introduction: https://imsun.net/posts/gitment-introduction/ # You can get your Github ID from https://api.github.com/users/ diff --git a/layout/_partials/comments.swig b/layout/_partials/comments.swig index cee31144c9..fb2758e21e 100644 --- a/layout/_partials/comments.swig +++ b/layout/_partials/comments.swig @@ -62,6 +62,11 @@ {% endif %} + {% elseif theme.gitalk.enable %} +
+
+
+ {% elseif theme.valine.appid and theme.valine.appkey %}
diff --git a/layout/_third-party/comments/gitalk.swig b/layout/_third-party/comments/gitalk.swig new file mode 100644 index 0000000000..d5c1bef171 --- /dev/null +++ b/layout/_third-party/comments/gitalk.swig @@ -0,0 +1,21 @@ +{% if not (theme.duoshuo and theme.duoshuo.shortname) and not theme.duoshuo_shortname %} + {% if theme.gitalk.enable %} + {% if page.comments %} + + + + {% endif %} + {% endif %} +{% endif %} diff --git a/layout/_third-party/comments/index.swig b/layout/_third-party/comments/index.swig index b2da2320af..9e9e478385 100644 --- a/layout/_third-party/comments/index.swig +++ b/layout/_third-party/comments/index.swig @@ -5,4 +5,5 @@ {% include 'livere.swig' %} {% include 'changyan.swig' %} {% include 'gitment.swig' %} +{% include 'gitalk.swig' %} {% include 'valine.swig' %}