Skip to content

Commit

Permalink
删除多说 修改 disqus 支持‘
Browse files Browse the repository at this point in the history
  • Loading branch information
yumemor committed Apr 25, 2017
1 parent cc03242 commit 41e1918
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 39 deletions.
19 changes: 9 additions & 10 deletions _config.yml
@@ -1,16 +1,15 @@
menus:
-
name: 首页
name: Home
link: /
-
name: 分类
link: category/
target: true
name: Category
link: categories/
-
name: 开源项目
name: Open-Source
link: open-source/
-
name: 留言板
name: Message
link: message/

profile:
Expand All @@ -25,8 +24,8 @@ github:
username: yumemor
popular_repos: [hexo-theme-primer]

comment:
duoshuo_username:
#disqus_username:

search: local #google|local

# 多说已关闭 目前只支持 disqus
comment:
disqus_username: disqus_name
14 changes: 3 additions & 11 deletions layout/_partial/article-post.ejs
@@ -1,6 +1,6 @@
<section class="container">
<div class="columns">
<div class="column <%if (page.toc == undefined ? true:page.toc) {%> three-fourths <%}%>" >
<div class="column <%if (page.toc == undefined ? true:page.toc) {%> three-fourths <%} else {%> single-column <%}%>" >
<article class="article-content markdown-body">
<%- post.content %>
</article>
Expand All @@ -10,22 +10,14 @@
</div>
<% } %>

<% if(page.donate) {%>
<iframe src="/donate" style="overflow-x:hidden;overflow-y:hidden; border:0xp none #fff; min-height:240px; width:100%;" frameborder="0" scrolling="no"></iframe>
<%}%>

<% if(page.comment == undefined ? true : page.comment) {%>
<%if(theme.comment.disqus_username){%>
<%- partial('_widget/disqus-comments',{
key: post.slug,
title: post.title,
url: config.url+url_for(post.path)
}) %>
<%} else {%>
<%- partial('_widget/duoshuo-comments',{
key: post.slug,
title: post.title,
url: config.url+url_for(post.path)
}) %>
<%}%>
<%}%>

Expand All @@ -37,4 +29,4 @@
<% } %>
</div>
</div>
</section>
</section>
35 changes: 18 additions & 17 deletions layout/_widget/disqus-comments.ejs
Expand Up @@ -2,24 +2,25 @@
<div class="comments">
<div id="disqus_thread"></div>
<script>
/**
* RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
* LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables
*/
/*
var disqus_config = function () {
this.page.url = PAGE_URL; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
*/
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = '//<%=theme.comment.disqus_username%>.disqus.com/embed.js';
var host = window.location.host;
var disqus_shortname = host.includes('127.0.0.1') || host.includes('0.0.0.0') || host.includes('localhost') ? '<%=theme.comment.disqus_username%>Dev' : '<%=theme.comment.disqus_username%>'
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
var disqus_title = '<%=title%>';
var disqus_config = function () {
this.page.url = '<%=url%>';
};
(function() {
var d = document, s = d.createElement('script');
s.src = '//<%=theme.comment.disqus_username%>.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
<noscript>
请启用JavaScript来查看 <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a>
</noscript>
</div>
8 changes: 7 additions & 1 deletion source/css/_partial/article.styl
@@ -1,6 +1,9 @@
#site-description
font-size: 45px

#site-description div
display: inline

.article-content
padding-top: 30px

Expand Down Expand Up @@ -140,4 +143,7 @@ ul.article-tag-list>li a
padding-top:30px

#container-open-source
margin-top:150px
margin-top:150px

.single-column-width
width: 100%

0 comments on commit 41e1918

Please sign in to comment.