-
Notifications
You must be signed in to change notification settings - Fork 39
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
Pagination #58
Comments
Yes, by using the features of the Jinja2 templating language on the site data structure that is made available to it automatically. |
Can you point me in the right direction for pagination? For example, I have an index.md that gets a list of all the files in the current directory. I'd like that list to be displayed in paginated form, which suggests Urubu generating index.md, index2.md, index3.md, etc, depending on how many items are shown on each page. Does Urubu do that? |
If someone else comes here looking for pagination, I have a fork that does it in the way I needed: https://github.com/jshaffstall/urubu It may not play well with all of Urubu's features, since I'm not currently using all of them. But it works for my use case. The changes are entirely in processors.py, if you want to update your copy of Urubu in site-packages. To generate paged index files, add the following front matter:
Change items_per_page to suit your needs. This will generate enough index.html variants (index.html, index2.html, index3.html, etc) to display all the items in chunks of items_per_page. Each page will get some new attributes added to help with templates. numpages - the number of total pages generated As an example of template navigation using these, this is what I used for mine:
You can also use this for non-index files if you have a suitable filter that will generate the items you want to display. Use this front matter instead:
Where the first word in the items_filter attribute is the name of the filter function, and the remaining words are parameters to that filter function. |
Hi is their a way to include pagination i.e top 5 -10 posts /news.
The text was updated successfully, but these errors were encountered: