add profile visibility config

This commit is contained in:
ppoffice 2015-06-11 19:56:09 +08:00
parent ed9502f4e6
commit a38a10761f
5 changed files with 36 additions and 22 deletions

View File

@ -7,11 +7,13 @@
<a class="main-nav-link" href="<%- url_for(theme.menu[i]) %>"><%= i %></a>
<% } %>
</nav>
<% if(theme.profile) { %>
<nav id="sub-nav">
<div class="profile" id="profile-nav">
<a id="profile-anchor" href="javascript:;"><img class="avatar" src="<%- url_for(config.avatar) %>"><i class="fa fa-caret-down"></i></a>
</div>
</nav>
<% } %>
<div id="search-form-wrap">
<%- search_form({button: ' '}) %>
</div>

View File

@ -3,9 +3,11 @@
<div id="container">
<%- partial('_partial/header') %>
<div class="outer">
<%- partial('_partial/profile', null, {cache: !config.relative_link}) %>
<% if (theme.profile){ %>
<%- partial('_partial/profile', null, {cache: !config.relative_link}) %>
<% } %>
<section id="main"><%- body %></section>
<% if (theme.sidebar && theme.sidebar !== 'bottom'){ %>
<% if (theme.sidebar){ %>
<%- partial('_partial/sidebar', null, {cache: !config.relative_link}) %>
<% } %>
</div>

View File

@ -36,28 +36,42 @@ logo-url = "images/logo.png"
sidebar = hexo-config("sidebar")
thumbnail-default-small = 'images/thumb-default-small.png'
// Profile
// Profile bar
profile = hexo-config("profile")
profile-avatar-size = 128px
// Layout
block-margin = 40px
article-padding = 20px
mobile-nav-width = 280px
profile-column = 3
sidebar-column = 3
sidebar-column-tablet = 4
main-column = 7
main-column-tablet = 9
sidebar-column = 3
profile-column = 3
sidebar-column-tablet = 4
if sidebar and sidebar isnt bottom
if sidebar
_sidebar-column = sidebar-column
else
_sidebar-column = 0
if profile
_profile-column = profile-column
else
_profile-column = 0
// Grids
column-width = 80px
gutter-width = 20px
columns = main-column + _sidebar-column + profile-column
if _sidebar-column is 0 and _profile-column is 0
columns = 10
main-column = 10
else
columns = main-column + _sidebar-column + _profile-column
if sidebar
main-column-tablet = 6
if profile
main-column-tablet = 9
// Media queries
mq-mini = "screen and (max-width: 559px)"

View File

@ -34,10 +34,6 @@ a
padding: 0 gutter-width
@media mq-mini
padding: 0
.inner
column(columns)
.left, .alignleft
float: left
@ -57,12 +53,14 @@ a
& > .outer
margin-bottom: 30px
if sidebar and sidebar isnt bottom
#main
@media mq-normal
column(main-column)
@media mq-tablet
#main
@media mq-normal
column(main-column)
@media mq-tablet
if sidebar
column(main-column-tablet)
else
width: 100%
@import "_extend"
@import "_partial/header"
@ -73,9 +71,7 @@ if sidebar and sidebar isnt bottom
@import "_partial/footer"
@import "_partial/highlight"
@import "_partial/mobile"
if sidebar
@import "_partial/sidebar"
@import "_partial/sidebar"
if sidebar is left
#main

View File

@ -1,5 +1,5 @@
(function($){
var toTop = $('#toTop').offset().top - $(window).height() + 20;
var toTop = $('#toTop').length ? $('#toTop').offset().top - $(window).height() + 20 : 0;
// Share
$('body').on('click', function(){