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

Previous/next post with category filter? #2270

Open
timpulver opened this Issue Nov 16, 2016 · 4 comments

Comments

2 participants
@timpulver

timpulver commented Nov 16, 2016

Hi,

I know I can display the previous and next post on a post page using something like this:

<% if (post.next){ %>
    <a href="<%- url_for(post.next.path) %>" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption"><%= __('older') %></strong>
      <div class="article-nav-title"><%= post.next.title %></div>
    </a>
  <% } %>

Is it possible to use a category filter with this? I have posts with category artist and of category project. If on a project site I would like a next / previous button to link to the next project only, not artist.

Thanks!

@NoahDragon

This comment has been minimized.

Show comment
Hide comment
@NoahDragon

NoahDragon Nov 17, 2016

Member

I don't think Hexo gonna support it. The downside I could see is the number of static files will be overwhelming.

Member

NoahDragon commented Nov 17, 2016

I don't think Hexo gonna support it. The downside I could see is the number of static files will be overwhelming.

@timpulver

This comment has been minimized.

Show comment
Hide comment
@timpulver

timpulver Nov 17, 2016

The site I’m building does not have that many projects / artists, so I think this should be okay.

If this is not possible, grabbing all posts, and comparing the create date to find the last / next one will probably work I guess, but I hoped there was an easier way.

timpulver commented Nov 17, 2016

The site I’m building does not have that many projects / artists, so I think this should be okay.

If this is not possible, grabbing all posts, and comparing the create date to find the last / next one will probably work I guess, but I hoped there was an easier way.

@NoahDragon

This comment has been minimized.

Show comment
Hide comment
@NoahDragon

NoahDragon Nov 17, 2016

Member

I think this related to your another issue. #2269
Could we just keep this one open and discuss the solution?

For now, I have to take a look the Hexo document to see if there is a way to suit your scenario. Or maybe it is a feature request.

Member

NoahDragon commented Nov 17, 2016

I think this related to your another issue. #2269
Could we just keep this one open and discuss the solution?

For now, I have to take a look the Hexo document to see if there is a way to suit your scenario. Or maybe it is a feature request.

@timpulver

This comment has been minimized.

Show comment
Hide comment
@timpulver

timpulver Nov 17, 2016

Feel free to close this one / the other one.
Thanks for your help!

timpulver commented Nov 17, 2016

Feel free to close this one / the other one.
Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment