Skip to content

Commit 4fd994d

Browse files
committed
modified comment.html, oauth values remained to be filled by the repo owner
1 parent dfe6b14 commit 4fd994d

File tree

2 files changed

+22
-20
lines changed

2 files changed

+22
-20
lines changed

_includes/comments.html

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
11
<section class="comments">
2-
<h3>Comments</h3>
3-
<div id="disqus_thread"></div>
2+
<div id="container"></div>
3+
<link rel="stylesheet" href="https://imsun.github.io/gitment/style/default.css">
4+
<script src="https://imsun.github.io/gitment/dist/gitment.browser.js"></script>
45
</section>
5-
<script type="text/javascript">
6-
var disqus_loaded = false;
76

8-
function load_disqus()
9-
{
10-
disqus_loaded = true;
11-
var disqus_shortname = '{{site.disqus_username}}';
12-
var disqus_title = '{{page.title.replace("'", "\\'")}}';
13-
var disqus_url = '{{page.url}}';
14-
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
15-
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
16-
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
17-
var ldr = document.getElementById('disqus_loader');
18-
};
7+
<script type="text/javascript">
8+
var gitment_loaded = false;
9+
var gitment = new Gitment({
10+
id: '页面 ID', // 可选。默认为 location.href
11+
owner: '你的 GitHub ID',
12+
repo: '存储评论的 repo',
13+
oauth: {
14+
client_id: '你的 client ID',
15+
client_secret: '你的 client secret',
16+
},
17+
})
18+
function load_gitment(){
19+
gitment_loaded = true
20+
gitment.render('container')
21+
}
1922
window.onscroll = function(e) {
2023
if ((window.innerHeight + window.scrollY) >= (document.body.offsetHeight - 800)) {
2124
//hit bottom of page
22-
if (disqus_loaded==false)
23-
load_disqus()
25+
if (gitment_loaded==false)
26+
load_gitment()
2427
}
2528
};
2629
</script>

assets/css/main.css

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1998,8 +1998,7 @@ pre span
19981998
text-decoration: none;
19991999
color: #5d4d7a
20002000
}
2001-
2002-
.comments
2001+
/*.comments
20032002
{
20042003
*zoom: 1;
20052004
width: auto;
@@ -2029,7 +2028,7 @@ pre span
20292028
margin: 0 0 1.875rem;
20302029
font-size: 1.875rem
20312030
}
2032-
2031+
*/
20332032
footer
20342033
{
20352034
background: #5d4d7a;

0 commit comments

Comments
 (0)