Skip to content

Commit

Permalink
fix(top post): fix pin on top (#257)
Browse files Browse the repository at this point in the history
* fix(topPost):fix Pin on top

* fix(topPost): fix theme.topPost
  • Loading branch information
cubesky authored and iblh committed Apr 9, 2017
1 parent 482d95b commit 77a48af
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
3 changes: 0 additions & 3 deletions _config.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,6 @@ sidebar:
# Qrcode for redirect at other device
qrcode: false

# Support Pin posts on the top of the list
topPost: false

# ---------------------------------------------------------------
# Integrated Services
# ---------------------------------------------------------------
Expand Down
24 changes: 12 additions & 12 deletions layout/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<div class="locate-thumbnail-symbol"></div>

<!-- Pin on top -->
<% if(theme.topPost) { %>
<% if(hasposttop(page.posts)) { %>
<% getposttop(page.posts).each(function(toppost){ %>
<% if(typeof hasposttop === 'function') { %>
<% if(hasposttop(site.posts)) { %>
<% getposttop(site.posts).each(function(toppost){ %>
<% if(theme.scheme === 'Paradox'){ %>
<!-- Paradox Thumbnail -->
<%- partial('_partial/Paradox-post_entry', { post: toppost, index: true, pin: true }) %>
Expand All @@ -25,15 +25,15 @@

<!-- Normal Post -->
<% page.posts.each(function(post) { %>
<% if(!(theme.topPost && post.top)) { %>
<% if(theme.scheme === 'Paradox') { %>
<!-- Paradox Thumbnail -->
<%- partial('_partial/Paradox-post_entry', { post: post, index: true, pin: false }) %>
<% } %>
<% if(theme.scheme === 'Isolation') { %>
<!-- Isolation Thumbnail -->
<%- partial('_partial/Isolation-post_entry', { post: post, index: true, pin: false }) %>
<% } %>
<% if(!((typeof hasposttop === 'function') && post.top)) { %>
<% if(theme.scheme === 'Paradox') { %>
<!-- Paradox Thumbnail -->
<%- partial('_partial/Paradox-post_entry', { post: post, index: true, pin: false }) %>
<% } %>
<% if(theme.scheme === 'Isolation') { %>
<!-- Isolation Thumbnail -->
<%- partial('_partial/Isolation-post_entry', { post: post, index: true, pin: false }) %>
<% } %>
<% } %>
<% }); %>

Expand Down

0 comments on commit 77a48af

Please sign in to comment.