daflh / vredeburg

A simple starter project to create a blog using Eleventy and Tailwind CSS
https://vredeburg.netlify.app
MIT License
185 stars 67 forks source link

Add Conditional for Paginator Partial #7

Closed FlyteWizard closed 3 years ago

FlyteWizard commented 3 years ago

Description

Added a conditional that will not render the paginator partial unless the number of posts or posts with a certain tag exceeds the paginate number set in the '_data/site.js' file. This change is applied to index.njk and partials/paginator.njk.

Why?

I think this is an appropriate addition as the option to change pages shouldn't be present until the user can change pages. This eliminates unnecessary page elements, and improves the simplistic aspect.

Tag Page

Tag List Page

Page with Paginator

Page with Paginator

Page without Paginator

Page without Paginator
daflh commented 3 years ago

Looks good, thanks!