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

Example of using the paginatehook property? #80

Open
iamalfonse opened this issue Jul 31, 2020 · 1 comment
Open

Example of using the paginatehook property? #80

iamalfonse opened this issue Jul 31, 2020 · 1 comment

Comments

@iamalfonse
Copy link

So I can see that there is a paginatehook property that can be enabled in the options (but not noted in the documentation). I'm just curious if there's a good example of how I'm able to use jekyll's pagination with the datapage-gen.

This is how I tried to set it up locally.

config.yml

page_gen:
  - data: blog
    index_files: true
    template: blog-post
    name: slug
    dir: blog
    paginatehook: true

pagination:
  enabled: true
  per_page: 5
  permalink: '/page/:num/'
  title: ' - page :num'
  limit: 0                # number of pages. 0 = all
  sort_field: 'date'
  sort_reverse: true

_layouts/blog-post

---
title: 'Blog'
pagination:
  enabled: true
---

{% for post in paginator.posts %}
<p>{{ post }}</p>
{% endfor %}

But it shows me posts found in other _posts directory instead of anything from the data found in the blog data. Any ideas?

@avillafiorita
Copy link
Owner

Hi -
it is the result of an old merge. Pagination could be more easily achieved with a specific option for the plugin, in my opinion. Planned for next release.

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

No branches or pull requests

2 participants