Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sidebar): can hide divider and footer #176

Merged
merged 2 commits into from
Jan 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions _config.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,30 @@ sidebar:
icon: email
homepage:
use: true
icon:
icon: home
divider: false
archives:
use: true
icon:
icon: inbox
divider: false
categories:
use: false
icon:
icon: chrome_reader_mode
divider: false
pages:
#About:
#link: "/about"
#icon: person
#divider: false
article_num:
use: false
divider: false
footer:
divider: true
theme: true
support: false
feedback: false
material: false

# Card Elevation Level
card_elevation: 2
Expand Down
64 changes: 39 additions & 25 deletions layout/_partial/sidebar-footer.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,53 @@ It will not impact the appearance and can give developers a lot of support :)
它不会影响美观并可以给开发者很大的支持和动力。 :)
-->

<!-- Sidebar Divider -->
<% if(theme.sidebar.footer.divider === true) { %>
<div class="sidebar-divider"></div>
<% } %>

<!-- Theme Material -->
<a href="https://github.com/viosey/hexo-theme-material" class="sidebar-footer-text-a" target="_blank">
<div class="sidebar-text mdl-button mdl-js-button mdl-js-ripple-effect sidebar-footer-text-div" data-upgraded=",MaterialButton,MaterialRipple">
<%= __('misc.theme') %> - Material
<span class="sidebar-badge badge-circle">i</span>
</div>
</a>
<% if(theme.sidebar.footer.theme === true) { %>
<a href="https://github.com/viosey/hexo-theme-material" class="sidebar-footer-text-a" target="_blank">
<div class="sidebar-text mdl-button mdl-js-button mdl-js-ripple-effect sidebar-footer-text-div" data-upgraded=",MaterialButton,MaterialRipple">
<%= __('misc.theme') %> - Material
<span class="sidebar-badge badge-circle">i</span>
</div>
</a>
<% } %>

<!-- Help & Support -->
<!--
<a href="mailto:hiviosey@gmail.com" class="sidebar-footer-text-a">
<div class="sidebar-text mdl-button mdl-js-button mdl-js-ripple-effect sidebar-footer-text-div" data-upgraded=",MaterialButton,MaterialRipple">
<%= __('sidebar.help') %>
<span class="mdl-button__ripple-container">
<span class="mdl-ripple"></span>
</span>
</div>
</a>
<% if(theme.sidebar.footer.support === true) { %>
<a href="mailto:hiviosey@gmail.com" class="sidebar-footer-text-a">
<div class="sidebar-text mdl-button mdl-js-button mdl-js-ripple-effect sidebar-footer-text-div" data-upgraded=",MaterialButton,MaterialRipple">
<%= __('sidebar.help') %>
<span class="mdl-button__ripple-container">
<span class="mdl-ripple"></span>
</span>
</div>
</a>
<% } %>
-->

<!-- Feedback -->
<!--
<a href="https://github.com/viosey/hexo-theme-material/issues" target="_blank" class="sidebar-footer-text-a">
<div class="sidebar-text mdl-button mdl-js-button mdl-js-ripple-effect sidebar-footer-text-div" data-upgraded=",MaterialButton,MaterialRipple">
<%= __('sidebar.feedback') %>
<span class="mdl-button__ripple-container"><span class="mdl-ripple"></span></span></div>
</a>
<% if(theme.sidebar.footer.feedback === true) { %>
<a href="https://github.com/viosey/hexo-theme-material/issues" target="_blank" class="sidebar-footer-text-a">
<div class="sidebar-text mdl-button mdl-js-button mdl-js-ripple-effect sidebar-footer-text-div" data-upgraded=",MaterialButton,MaterialRipple">
<%= __('sidebar.feedback') %>
<span class="mdl-button__ripple-container"><span class="mdl-ripple"></span></span></div>
</a>
<% } %>
-->

<!-- Abount Theme -->
<!-- About Theme -->
<!--
<a href="https://blog.viosey.com/index.php/Material.html" target="_blank" class="sidebar-footer-text-a">
<div class="sidebar-text mdl-button mdl-js-button mdl-js-ripple-effect sidebar-footer-text-div" data-upgraded=",MaterialButton,MaterialRipple">
<%= __('sidebar.about_theme') %>
<span class="mdl-button__ripple-container"><span class="mdl-ripple"></span></span></div>
</a>-->
<% if(theme.sidebar.footer.material === true) { %>
<a href="https://blog.viosey.com/index.php/Material.html" target="_blank" class="sidebar-footer-text-a">
<div class="sidebar-text mdl-button mdl-js-button mdl-js-ripple-effect sidebar-footer-text-div" data-upgraded=",MaterialButton,MaterialRipple">
<%= __('sidebar.about_theme') %>
<span class="mdl-button__ripple-container"><span class="mdl-ripple"></span></span></div>
</a>
<% } %>
-->
35 changes: 24 additions & 11 deletions layout/_partial/sidebar-navigation.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
<%= __('sidebar.homepage') %>
</a>
</li>
<% if(theme.sidebar.homepage.divider === true) { %>
<li class="divider"></li>
<% } %>
<% } %>

<!-- Archives -->
Expand All @@ -48,6 +51,9 @@
}) %>
</ul>
</li>
<% if(theme.sidebar.archives.divider === true) { %>
<li class="divider"></li>
<% } %>
<% } %>

<!-- Categories -->
Expand All @@ -71,12 +77,11 @@
}) %>
</ul>
</li>
<% if(theme.sidebar.categories.divider === true) { %>
<li class="divider"></li>
<% } %>
<% } %>

<!-- Divider -->
<li class="divider"></li>


<!-- Pages -->
<% for (var i in theme.sidebar.pages){ %>
<li>
Expand All @@ -87,13 +92,21 @@
<%= i %>
</a>
</li>
<% if(theme.sidebar.pages[i].divider === true) { %>
<li class="divider"></li>
<% } %>
<% } %>

<!-- Article Numebr -->
<li>
<a href="/archives">
<%= __('sidebar.article_num') %>
<span class="sidebar-badge"><%= site.posts.length %></span>
</a>
</li>
<!-- Article Number -->
<% if(theme.sidebar.article_num.use === true) { %>
<li>
<a href="/archives">
<%= __('sidebar.article_num') %>
<span class="sidebar-badge"><%= site.posts.length %></span>
</a>
</li>
<% if(theme.sidebar.article_num.divider === true) { %>
<li class="divider"></li>
<% } %>
<% } %>
</ul>
3 changes: 0 additions & 3 deletions layout/_partial/sidebar.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
<!-- Sidebar Navigation -->
<%- partial('_partial/sidebar-navigation') %>

<!-- Sidebar Divider -->
<div class="sidebar-divider"></div>

<!-- Sidebar Footer -->
<%- partial('_partial/sidebar-footer') %>
</div>
Expand Down