Skip to content

Commit c31b12e

Browse files
committed
Add Disqus
1 parent b04b343 commit c31b12e

File tree

6 files changed

+40
-21
lines changed

6 files changed

+40
-21
lines changed

_config.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ nickname: '悟空'
1616
bio: '前端开发者,热爱技术&设计,简单乐观爱创造'
1717
avatar: 'assets/img/profile.png'
1818

19-
# theme color
19+
# Comments
20+
disqus: true
21+
22+
# theme color 主题皮肤
2023
theme-color: 'default' # pink or default
2124

2225
# Post header background patterns (when the post no cover): circuitBoard, overlappingCircles, food, glamorous, ticTacToe, seaOfClouds
@@ -29,7 +32,7 @@ sns:
2932
instagram: '//www.instagram.com/steveliaocn'
3033
github: '//github.com/kaeyleo'
3134

32-
# Tags
35+
# Tags 设置标签
3336
recommend-tags: true # whether or not display recommend-tags on the sidebar
3437
recommend-condition-size: 12 # a tag will be recommended if the size of it is more than this value
3538

_layouts/post.html

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,28 @@ <h2 class="post-subtitle">{{ page.subtitle }}</h2>
8686
</div>
8787
{% endif %}
8888
</section>
89+
{% if site.disqus %}
90+
<section class="comment">
91+
<div id="disqus_thread"></div>
92+
</section>
93+
{% endif %}
8994
</div>
90-
95+
<script>
96+
/**
97+
* RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
98+
* LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/
99+
/*
100+
var disqus_config = function () {
101+
this.page.url = PAGE_URL; // Replace PAGE_URL with your page's canonical URL variable
102+
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
103+
};
104+
*/
105+
(function() { // DON'T EDIT BELOW THIS LINE
106+
var d = document, s = d.createElement('script');
107+
s.src = 'https://liaokeyu.disqus.com/embed.js';
108+
s.setAttribute('data-timestamp', +new Date());
109+
(d.head || d.body).appendChild(s);
110+
})();
111+
</script>
112+
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
91113
{% include footer.html %}

assets/css/app.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/css/github-markdown.css

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -293,12 +293,13 @@
293293
.markdown-body h2 {
294294
font-size: 24px;
295295
font-weight: 600;
296-
margin-top: 40px;
296+
margin-top: 32px;
297297
}
298298

299299
.markdown-body h3 {
300300
font-size: 20px;
301301
font-weight: 600;
302+
margin: 26px 0 12px;
302303
}
303304

304305
.markdown-body h4 {
@@ -319,7 +320,7 @@
319320
.markdown-body p {
320321
margin-bottom: 16px;
321322
font-size: 16px;
322-
line-height: 1.8;
323+
line-height: 1.75;
323324
text-align: justify;
324325
}
325326

@@ -470,18 +471,6 @@
470471
box-shadow: inset 0 -1px 0 #959da5;
471472
}
472473

473-
/*.markdown-body h1,
474-
.markdown-body h2,
475-
.markdown-body h3,
476-
.markdown-body h4,
477-
.markdown-body h5,
478-
.markdown-body h6 {
479-
margin-top: 24px;
480-
margin-bottom: 16px;
481-
font-weight: 600;
482-
line-height: 1.25;
483-
}*/
484-
485474
.markdown-body h1 .octicon-link,
486475
.markdown-body h2 .octicon-link,
487476
.markdown-body h3 .octicon-link,
@@ -652,4 +641,4 @@
652641

653642
.markdown-body hr {
654643
border-bottom-color: #eee;
655-
}
644+
}

dev/sass/app.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,9 +539,11 @@ a {
539539
.author-detail {
540540
position: relative;
541541
top: -35px; }
542-
.author-detail .author-card {
542+
.author-detail .author-card, .author-detail .comment {
543543
width: 720px;
544544
margin: 0 auto; }
545+
.author-detail .comment {
546+
margin-bottom: 60px; }
545547

546548
.read-next {
547549
display: flex;

dev/sass/common.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,10 +452,13 @@
452452
.author-detail {
453453
position: relative;
454454
top: -35px;
455-
.author-card {
455+
.author-card, .comment {
456456
width: $post-content-w;
457457
margin: 0 auto;
458458
}
459+
.comment {
460+
margin-bottom: 60px;
461+
}
459462
}
460463

461464
.read-next {

0 commit comments

Comments
 (0)