-
Notifications
You must be signed in to change notification settings - Fork 949
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
Include unrendered pages in sections, add render property to templates #2585
base: next
Are you sure you want to change the base?
Conversation
That would be a big breaking change I think, and things like the sitemap would start showing them afaik? Maybe taxonomies as well. Do they need to be mixed with the other pages? |
Note that they'd only be included in taxonomies if they were explicitly added to them, and at least imho, it's kind of weird to add a page you explicitly don't want to render to a taxonomy instead of just using the extra data. Although I'll test to see if they're added to taxonomies anyway, since I believe it just affects sections. At least on my site which is using the change, they still aren't included on the sitemap. I'll look into adding a few tests that check how unrendered pages are added to various parts of the site; these would be nice anyway considering how afaik this feature remains largely untested in the code. |
Current progress: updated the site test to add an explicit check that an unrendered page is not in the sitemap, and also added an extra test that they can be accessed via templates. Still need to test that they don't show up in taxonomies, though. |
17ee076
to
d0cdcd2
Compare
So, at least for now, I'm excluding taxonomies entirely. There may be a benefit to also including unrendered pages in taxonomies, but at least for now, they are explicitly excluded and there are tests for this. |
d0cdcd2
to
ca1bd45
Compare
ca1bd45
to
995e116
Compare
* They can be accessed through templates directly and through sections * Unrendered pages are not added to sitemaps * Unrendered pages are not added to taxonomies
995e116
to
4dc7353
Compare
next
branch?On my blog, I make use of pages which aren't rendered but included in a section to make templating a little easier. What feels like the best way to ensure this is done correctly on the upstream zola is to add these pages to sections, but explicitly allow accessing the
render
field from templates to filter them out (or, in my case, not show permalinks, since they would not be rendered).This seems reasonable considering how drafts also can be detected in templates as well, when drafts are enabled.
I can't imagine this affecting many blogs, but I can go for an alternative approach otherwise.
Note that this only affects directly sections, and does not affect taxonomies. Taxonomies explicitly exclude unrendered pages, and will not even let unrendered pages add new terms.