Skip to content

Fix get_section ordering and subsection shape in template context#252

Open
Dekker1 wants to merge 1 commit into
bearcove:mainfrom
Dekker1:fix/get_section_sort
Open

Fix get_section ordering and subsection shape in template context#252
Dekker1 wants to merge 1 commit into
bearcove:mainfrom
Dekker1:fix/get_section_sort

Conversation

@Dekker1
Copy link
Copy Markdown

@Dekker1 Dekker1 commented Apr 13, 2026

This fixes an inconsistency between the normal page/section template context and the get_section(...) template helper.

Currently, get_section(...) built its own reduced section value in template_host.rs. In this version, I found two problems:

  • pages were returned in route order instead of weight order
  • subsections were returned as path strings rather than full section objects, so template-side sorting by weight could not work

This patch makes get_section(...) reuse the existing section_to_value(...) serializer from render.rs, which is already the canonical section representation used elsewhere.

Re-using the `section_to_value` function in `template_host` that was
defined and used in `render`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant