✨ feat: support using info-page.html for sections #455
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This change makes it possible to use the
info-page.html
template on the root path ("/"
), which in zola is always a "section" and can't be set to "page".The related issue(s) is/are actually in zola and not really in tabi. It's a known limitation in zola that the root path has to be a section and can't be a page (see linked issues later). Because of that templates designed for pages typically can't be used for sections (and thus not as a root path "/" landing page).
Thankfully in tabi a lot of things are already pretty agnostic between sections and pages, so it only needed some minor tweaks to make the template work at the root level.
Related issues
As said before, not really a tabi issue, but here are related zola issues and discussions:
Slightly related (but very old / fixed / obsolete)
Changes
extra-features.html
Before this change, this partial failed to render for sections, because it called the macro
evaluate_setting_priority
with the section as page parameter which caused the line{%- for i in range(start=1, end=components | length) -%}
to fail, becausestart
(1) was larger than theend
(0) parameter.It looked to me like the section parameter was added later to
evaluate_setting_priority
(because it has a default value and the parameter documentation is missing) so I made a change inextra-features.html
to pass page and section separately if they are set (or""
if they are not set).info-page.html
I updated the
info-page.html
to also support both pages and sections.Screenshots
Type of change
extra-features.html
should be backwards compatible, but I'm not 100% sure.Checklist
theme.toml
with a sane default for the featureconfig.toml
in tabi-startconfig.toml
commentstheme.toml
comments