You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I am writing a eleventyComputed global data function that sets permalinks based on another piece of data from frontmatter. If a file has draft: true then the permalink is set to false and the page is unpublished. However, this breaks pagination even if the permalink value is untouched because Pagination.js plugin won't manage the page numbers if there a permalink exists, regardless of value. Therefore, it's impossible to globally manipulate permalinks.
Unfortunately, I don't have enough context on how the pagination system works under the hood to try other alternatives or solutions. From my understanding of permalinks, the only way to get a page to not be published is to set permalink to false. If there is another way to do drafts that doesn't touch permalinks, I could consider that.
It's possible that v3's Preprocesser API may be the preferred way to now do drafts. I'm currently on v2 so setting permalink to false is the recommended way there, where my issue is. Might not be worth the patch to an old version?
Is your feature request related to a problem? Please describe.
I am writing a
eleventyComputed
global data function that sets permalinks based on another piece of data from frontmatter. If a file hasdraft: true
then the permalink is set to false and the page is unpublished. However, this breaks pagination even if the permalink value is untouched because Pagination.js plugin won't manage the page numbers if there a permalink exists, regardless of value. Therefore, it's impossible to globally manipulate permalinks.Example code:
Describe the solution you'd like
I would like Pagination.js to check the return value of the computed permalink function, rather than just the existence of the permalink config key.
eleventy/src/Plugins/Pagination.js
Line 276 in e06b57e
A quick edit to my locally installed 11ty node module to that line shows this working, using
undefined
as the check:Describe alternatives you've considered
Unfortunately, I don't have enough context on how the pagination system works under the hood to try other alternatives or solutions. From my understanding of permalinks, the only way to get a page to not be published is to set permalink to false. If there is another way to do drafts that doesn't touch permalinks, I could consider that.
Additional context
Related issue: #3241
The text was updated successfully, but these errors were encountered: