Skip to content

Commit

Permalink
feat: read disqus_shortname from theme config (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang authored Apr 8, 2024
1 parent 9a1700c commit 64961f7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ google_analytics:
rss:
# Display a "Read More" link under each post's excerpt in /archives page
#excerpt_link: 'Read More'

disqus_shortname:
4 changes: 2 additions & 2 deletions layout/_partial/after_footer.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<%- js('js/jquery.imagesloaded.min.js') %>
<%- js('js/gallery.js') %>

<% if (config.disqus_shortname){ %>
<% if (theme.disqus_shortname){ %>
<script>
var disqus_shortname = '<%= config.disqus_shortname %>';
var disqus_shortname = '<%= theme.disqus_shortname %>';
(function(){
var dsq = document.createElement('script');
Expand Down
2 changes: 1 addition & 1 deletion layout/_partial/article.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<footer class="meta">
<%- partial('post/category') %>
<%- partial('post/tag') %>
<% if (config.disqus_shortname && item.comment){ %>
<% if (theme.disqus_shortname && item.comments){ %>
<a href="<%- item.permalink %>#disqus_thread" class="comment"><%= __('comment') %></a>
<% } %>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion layout/_partial/comment.ejs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% if (config.disqus_shortname && page.comments){ %>
<% if (theme.disqus_shortname && page.comments){ %>
<section id="comment">
<div id="disqus_thread" aria-live="polite">
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
Expand Down

0 comments on commit 64961f7

Please sign in to comment.