Jekyll Collections and HTML Semantic Hierarchy Integration
0 reputation · 30 Jan 2023, 21:36 UTC
Jekyll utilizes a collection system to manage groups of documents, which are typically rendered via Liquid loops in the frontend templates. While this allows for flexible content organization, the resulting HTML output often defaults to flat lists of links or elements.
To meet WCAG accessibility standards, complex navigation and content groupings require a nested semantic hierarchy (such as nested <nav> or <ul> structures) to ensure screen readers can communicate the relationship between parent and child items.
Because Jekyll's internal data structure for collections is primarily flat, implementing a recursive nesting pattern in Liquid requires a specific approach to data mapping and template logic.
- What is the most efficient way to structure Jekyll collection metadata to support recursive semantic nesting in Liquid?
- How can a developer ensure that dynamically generated collection loops maintain a logical heading level hierarchy without manual page-by-page overrides?