-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
Collections.all only lists first page created with pagination, not others #253
Comments
As a workaround I tried adding a default tag
|
Hmm this was by design but maybe it isn’t right. If you are using pagination to provide numeric paged links to a very large data set the current behavior makes sense. But if you’re using pagination to provide individual distinct pages of a collection of data, this certainly makes less sense. HMM. |
This was previously discussed at #76 (comment) |
I'm very much in the camp of using it to provide a page per thing. It's a limitation as I don't think it's otherwise easy to get access to the data you'd need to know about which pages have been created - or at least makes the code more complex as you have to separately iterate through each thing you do pagination on, and if you use collections.all, filter for the first item in that paginated set. Similar for wanting to list pages in site-maps - which will be incomplete right now. Conversely, it seems each collection you add gets listed in collections.all, even if they're not creating a page. Currently I'm using pagination it for a page per tag, per image asset, and per date. It's super useful - a great feature. @zachleat Slightly buried in my report is another (related) possible bug that if you add tags to the pagination template, the pages generated with pagination don't show up under that tag's collection. |
After mulling it over sufficiently long, I'm on board with this. I'm filing as a bug because it doesn't currently work for Object based paginations but it might be called a feature request too. I think this should be a pagination option that can be changed on a per template basis. Thanks for pushing back on this @edwardhorsford. |
Super, glad to hear it! Totally on board with it being an opt-in feature or whatever. To me it makes a lot of sense for dynamic pages, but not so much sense for paginated groups of things. -- Related: will tags applied in paginated templates get applied to the pages? they aren't currently. |
Absolutely @edwardhorsford, this feature will apply to all collections. |
Spent a little bit of time looking at this, just fair warning it’s gonna take a bit of work to get it going and isn’t going to make it in to 0.7.0. I am still very much on board with the idea. |
Complete. This will be included with 0.7.2. Opt-in with:
This will likely be the default in 1.0. |
Major version default change filed at #407. |
So happy for this! Thanks a million! |
…xes `templateContent` missing in a few places.
@edwardhorsford Would love some help testing this fix out, if you want to point your package.json to use the git repo |
@zachleat I'm still on 0.6 (started a new job recently which has occupied my time) - but will try to test out shortly. Any particular areas to focus on? For tag pages, I know how many tags I have so should be able to easily see if the right number of pages exist, etc. |
@zachleat Might take me a bit of time to test after all. Turns out I was on 0.5.4 and versions since then don't compile correctly. Some of my site is rendered fine, but some is rendering out html. Weirdly I'm not getting any errors in the terminal. The problem seems to start with v6.0 - so I'll have a look through what changed to try to work it out. If you have any ideas I'd be grateful. EDIT: it looks like my main content block inserted in my templates is being escaped. I'm using |
@zachleat I didn't resolve the above issue, so have disabled autoescape on my site for now. 0.71 works for me, but 0.72 doesn't. I get the following error: I'm indexing in to |
@zachleat Just a note to say that after removing all the I suspect there might be a bug though - I don't see why my previous data format of collections being inside an array would now stop working. I may try making a reduced test case to see. Still having an issue with all output being escaped. I've disabled globally for now until I find a solution. |
@edwardhorsford Are you using Nunjucks? I don’t see any autoescape changes in the release notes there hmm https://github.com/mozilla/nunjucks/releases Seems to still be on by default (as it has always been?): |
Pages made with pagination don't all get added to
collections.all
. Only the first page created appears.Similarly, if I apply a tag
foo
to the pages,collections.foo
only contains a single item - even though i'm generating more than 100 pages with pagination and this tag.This causes me some issues as I don't know how to easily list / iterate over the pages created with pagination.
The text was updated successfully, but these errors were encountered: