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

fix(top post): fix pin on top #257

Merged
merged 2 commits into from
Apr 9, 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
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