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

Check pagination size before adding pagination numbers #28

Merged
merged 1 commit into from
Mar 20, 2021

Conversation

daviddarnes
Copy link
Contributor

There's a clever trick inside of Eleventy if you're wanting to create single views from an array of items, by using the pagination option and setting a size of 1. The best example of this is within the Eleventy docs where it's used to produce tag pages

Prior to this change paginated pages would show a page number as well as apply a "noindex" meta value to the page. This is undesirable if you're using the aforementioned method to produce pages. This change checks if the size value is above 1 and then applies the page number and noindex value. I've tested this on a development project and added tests to the PR, which appear to be passing. Fixes #27

PS. Wasn't sure which branch to put this against, let me know if it's meant to be master instead of develop 👍🏻

@artstorm
Copy link
Owner

@daviddarnes Thank you for the PR. Its an excellent addition. Sorry about the long delay before I got around checking it out. I'll go ahead and merge it. 👍🏻

@artstorm artstorm merged commit 34c5021 into artstorm:develop Mar 20, 2021
@daviddarnes
Copy link
Contributor Author

daviddarnes commented Mar 20, 2021

No problem @artstorm! Thanks for merging it in, when will this change be available on npm?

@aarongustafson
Copy link
Contributor

Same question as @daviddarnes. I’d love to see this published as I’m about to drop the extension to get rid of the page numbers on tag pages.

@aarongustafson
Copy link
Contributor

Even better would be an option to disable specific tags output by the plugin so you could handle them separately. For instance, maybe I want to handle title, but let the plugin handle everything else…

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

Successfully merging this pull request may close these issues.

3 participants