Skip to content

Commit 08daa8a

Browse files
committed
add gitment
1 parent aa3f0cc commit 08daa8a

6 files changed

Lines changed: 651 additions & 16 deletions

File tree

_config.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
menu:
22
Blog: /
33
Archive: /archives/
4-
Weibo: http://weibo.com/sunchongsheng
5-
GitHub: https://github.com/pinggod
4+
Links: /friends/
5+
GitHub: https://github.com/coolrc136
66
Rss: /atom.xml
77

88
favicon: /favicon.png
99
logo: /favicon.png
1010

1111
# Comment
1212
# e.g disqus: seansun
13-
disqus:
14-
duoshuo:
13+
#disqus:
14+
#duoshuo: coolrc
15+
gitment:
16+
repo: blog_comment
17+
id: coolrc136
18+
clientid: 54a5c97e9smfbhkrn
19+
clientsecret: 475f010e505sbvhsdbkfsbrno
1520

1621
# Analytics
1722
# google-analytics:
18-
ga: UA-65933410-1
23+
ga: UA-71skjfks
1924

2025
# Copyright Infomation
2126
startyear: 2015

layout/mixins/post.jade

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,10 @@ mixin post(item)
4444
!= item.title
4545
+postInfo(item)
4646
.post-content
47-
!= item.content
47+
!= item.content
48+
.post-info
49+
- var updatedtime = full_date(item.updated, 'll')
50+
- updatedtime = "last updated: " + updatedtime
51+
!= updatedtime
52+
a.post-info(href= url_for(item.copyrightlink))
53+
!= item.copyright

layout/partial/comment.jade

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,21 @@ if theme.disqus
2424
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
2525
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
2626
})();
27-
script(id='dsq-count-scr' src='//#{theme.disqus}.disqus.com/count.js' async)
27+
script(id='dsq-count-scr' src='//#{theme.disqus}.disqus.com/count.js' async)
28+
29+
30+
if theme.gitment
31+
#render
32+
link(rel="stylesheet", href=url_for("https://imsun.github.io/gitment/style/default.css"))
33+
script(src='https://imsun.github.io/gitment/dist/gitment.browser.js')
34+
script.
35+
var gitment = new Gitment({
36+
//id: '页面 ID', // 可选。
37+
owner: '#{theme.gitment.id}',
38+
repo: '#{theme.gitment.repo}',
39+
oauth: {
40+
client_id: '#{theme.gitment.clientid}',
41+
client_secret: '#{theme.gitment.clientsecret}',
42+
},
43+
})
44+
gitment.render('render')

layout/partial/head.jade

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,11 @@ link(rel="stylesheet", href=url_for("css/apollo.css"))
1313

1414
- var xml = config.url + '/atom.xml'
1515
link(rel="search", type="application/opensearchdescription+xml", href=xml, title=config.title)
16-
16+
17+
//- Analytics tracking
18+
- var ga = theme.ga
19+
if ga
20+
script
21+
| (function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;e=o.createElement(i);r=o.getElementsByTagName(i)[0];e.src='//www.google-analytics.com/analytics.js';r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));ga('create',
22+
!= '"' + ga + '"'
23+
| ,'auto');ga('send','pageview');

layout/partial/scripts.jade

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
//- LaTex
22
script(async src="//cdn.bootcss.com/mathjax/2.6.1/MathJax.js?config=TeX-MML-AM_CHTML")
33

4-
//- Analytics tracking
5-
- var ga = theme.ga
6-
if ga
7-
script
8-
| (function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;e=o.createElement(i);r=o.getElementsByTagName(i)[0];e.src='//www.google-analytics.com/analytics.js';r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));ga('create',
9-
!= '"' + ga + '"'
10-
| ,'auto');ga('send','pageview');
4+
//- 多说https
5+
if theme.duoshuo
6+
script(src="https://dn-hb0716.qbox.me/duoshuo.js")

0 commit comments

Comments
 (0)