-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
72 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<% if (theme.social && theme.social.comment) { %> | ||
<% if (theme.social.comment.disqus) { %> | ||
<%- partial('_ksio/widgets/disqus') %> | ||
<% } %> | ||
<% } %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<% const comment_config = theme.social && theme.social.comment && theme.social.comment.disqus %> | ||
<% const disqus_shortname = comment_config && env.env === 'production' ? comment_config.shortname : '' %> | ||
<% if (comment_config && disqus_shortname) { %> | ||
<% const page_url = page.permalink %> | ||
<% const page_id = page_url.replace(config.url, '') %> | ||
<div id="disqus_thread"></div> | ||
<% if (comment_config.proxy) { %> | ||
<%- js('javascripts/ksio/vendors/disqusjs.min') %> | ||
<script> | ||
var dsqjs = new DisqusJS({ | ||
shortname: '<%= disqus_shortname %>', | ||
siteName: '<%= config.title %>', | ||
identifier: '<%= page_id %>', | ||
url: '<%= page_url %>', | ||
title: '<%= page.title %>', | ||
api: '<%= comment_config.proxy.endpoint %>', | ||
apikey: '<%= comment_config.proxy.key %>', | ||
admin: '<%= comment_config.username %>', | ||
adminLabel: '<%= comment_config.label || "管理员" %>' | ||
}); | ||
</script> | ||
<% } else { %> | ||
<script> | ||
var disqus_config = function () { | ||
this.page.link = '<%= page_url %>'; | ||
this.page.identifier = "<%= page_id %>"; | ||
this.page.title = '<%= page.title %>'; | ||
}; | ||
(function() { | ||
var d = document, s = d.createElement('script'); | ||
s.src = '//<%= disqus_shortname %>.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="external ">comments powered by Disqus.</a></noscript> | ||
<script id="dsq-count-scr" src="//<%= disqus_shortname %>.disqus.com/count.js" async></script> | ||
<% } %> | ||
<% } %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<% if (site.ksio.social.share !== false) { %> | ||
<div class="Widget Widget--share"> | ||
<div class="Widget-body"> | ||
<p>分享到<i class="fa fa-share-alt"></i></p> | ||
<div class="social-share" data-sites="wechat,weibo,twitter"></div> | ||
</div> | ||
</div> | ||
<% } %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<section class="Widget Widget--toc"> | ||
<div class="Widget-header"> | ||
<h2 class="Widget-title">目录</h2> | ||
</div> | ||
<div class="Widget-body"></div> | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters