add: include and exclude filters for pagination#3103
add: include and exclude filters for pagination#3103Snapstromegon wants to merge 8 commits into11ty:mainfrom
Conversation
This Commit adds the `include` and `exclude` attributes to the pagination plugin. This allows for more semantic filtering in a backwards compatible manner. This commit also adds the required tests based on the existing filter tests. TODO: Remove old `filter` for v3.0 Signed-off-by: Raphael Höser <raphael@hoeser.info>
|
It seems like there are some merge conflicts. I will take care of those. |
This Commit adds the `include` and `exclude` attributes to the pagination plugin. This allows for more semantic filtering in a backwards compatible manner. This commit also adds the required tests based on the existing filter tests. TODO: Remove old `filter` for v3.0 Signed-off-by: Raphael Höser <raphael@hoeser.info>
…apstromegon/eleventy into issue-2522-pagination-include-exclude Signed-off-by: Raphael Höser <raphael@hoeser.info>
Signed-off-by: Raphael Höser <raphael@hoeser.info>
Co-authored-by: uncenter <47499684+uncenter@users.noreply.github.com>
Co-authored-by: uncenter <47499684+uncenter@users.noreply.github.com>
| return excluded === value; | ||
| } | ||
|
|
||
| // Let's keep this code for backwards compatibility to V2. |
There was a problem hiding this comment.
We can remove this old filter property logic now I think.
There was a problem hiding this comment.
I'd be happy to do so, but I think this should be communicated, since it affects the public API of this plugin. Is there a way to log warnings if someone still uses filters?
There was a problem hiding this comment.
Maybe we add a warning when someone uses filter that says "The filter Pagination property has been deprecated in Eleventy v3. You can replace it with exclude for the same effect".
There was a problem hiding this comment.
Yes, exactly. My question is, if there is a better way than throwing an error or using console.warn for this.
There was a problem hiding this comment.
I don't see anywhere else where we are throwing an error or console.warn-ing for a deprecation. Seems like those just get tagged as deprecated with JSDoc but aren't removed or changed.
There was a problem hiding this comment.
Hey @zachleat, how would you want me to handle this here?
Maybe you even have an opinion on doing a breaking change.
Signed-off-by: Raphael Höser <raphael@hoeser.info>
Signed-off-by: Raphael Höser <raphael@hoeser.info>
This Commit adds the
includeandexcludeattributes to the pagination plugin. This allows for more semantic filtering in a backwards compatible manner.This commit also adds the required tests based on the existing filter tests.
TODO: Remove old
filterfor v3.0fixes: #2522 with option 1 from this comment