fix(sidebar & comment): hidden comment section if no comment plugin selected & allow empty value for sidebar widgets

This commit is contained in:
ppoffice 2017-06-05 21:49:08 +08:00
parent 5fa0dafb4c
commit 3ed3b9ee22
3 changed files with 11 additions and 11 deletions

View File

@ -22,7 +22,7 @@ customize:
location: Harbin, China
follow: https://github.com/ppoffice/
highlight: monokai
sidebar: right # sidebar position, options: left, right
sidebar: right # sidebar position, options: left, right or leave it empty
thumbnail: true # enable posts thumbnail, options: true, false
favicon: # path to favicon
social_links:

View File

@ -1,19 +1,17 @@
<% if (post.comments) { %>
<section id="comments">
<% if (theme.comment.disqus) { %>
<%- partial('comment/disqus') %>
<section id="comments"><%- partial('comment/disqus') %></section>
<% } else if (theme.comment.duoshuo) { %>
<%- partial('comment/duoshuo') %>
<section id="comments"><%- partial('comment/duoshuo') %></section>
<% } else if (theme.comment.youyan) { %>
<%- partial('comment/youyan') %>
<section id="comments"><%- partial('comment/youyan') %></section>
<% } else if (theme.comment.facebook) { %>
<%- partial('comment/facebook') %>
<section id="comments"><%- partial('comment/facebook') %></section>
<% } else if (theme.comment.isso) { %>
<%- partial('comment/isso') %>
<section id="comments"><%- partial('comment/isso') %></section>
<% } else if (theme.comment.changyan && theme.comment.changyan.appid && theme.comment.changyan.conf) { %>
<%- partial('comment/changyan') %>
<section id="comments"><%- partial('comment/changyan') %></section>
<% } else if (theme.comment.gitment) { %>
<%- partial('comment/gitment') %>
<section id="comments"><%- partial('comment/gitment') %></section>
<% } %>
</section>
<% } %>

View File

@ -1,6 +1,8 @@
<% if (Array.isArray(theme.widgets) && theme.widgets.length > 0) { %>
<aside id="sidebar">
<% theme.widgets.forEach(function(widget) { %>
<%- partial('widget/' + widget) %>
<% }) %>
<div id="toTop" class="fa fa-angle-up"></div>
</aside>
</aside>
<% } %>