-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feature request: previous and next archive links #2
Comments
This is definitely the right place for feature requests. You might be able to do something with Liquid tags: There are two problems with that, though:
So I think there needs to be something exposed through this plugin. I'm thinking two new variables— Would that work? If so I'm going to shoot for getting it into the next feature release, 0.2.0. |
That sounds absolutely perfect, thanks again Mark! |
Paging has now been added to the 0.2 branch of JAG. Instead of the API I described earlier, I decided to use Jekyll's built-in paginator, so it works exactly as described on the Pagination doc page, with the exception that you do not need to do anything in your |
Thanks for this Mark, JAG works really well! One thing I'm still trying to achieve however is being able to output the name of the next/previous page. Currently |
{% assign previous_index = paginator.previous_page | minus: 1 %}
{{ paginator.posts[previous_index].title }} N.B. you have to subtract one from {% assign next_index = paginator.next_page | minus: 1 %}
{{ paginator.posts[next_index].title }} |
Hmm, that doesn't seem to be working. Here's the code I'm currently using:
Is this correct? I also wish to use URLs minus .html extension, so /2012/12/ instead of /2012/12/index.html. Both these use cases require getting the date of the previous/next archive page. Is that functionality available? |
That should be it: I copied and pasted your code into my own archive.html and the titles came through. Do the titles come through on any of the archive types (daily, monthly, yearly)? What happens if instead of For the URL issue, just use the {{ paginator.previous_page_path | remove: 'index.html' }} |
Turns out this value was being generated, but only on earlier archives. The information shown however was clearly wrong, leading me to file the latest bug report; the global value for pagination increments should probably not effect the pagination of archives. |
(Oh, and thanks for the .html removal tip!) |
Hello again,
Not sure if this is the right place to make feature request, but is it possible to extend this plugin so that archive pages can have links to their previous and next day/month/year? Or is there an easy way to do this with Jekyll/Liquid already without adapting this plugin?
(Forgive me, but I am new to Jekyll, and just learning how it all works and understanding what's possible. I also programme in so much as I copy and paste bits of code, cross my fingers and hoping that something works!)
Thanks!
Paul
The text was updated successfully, but these errors were encountered: