Custom section layouts
Override the default section-index and article templates for a single section, so one section can look and behave differently from the others.
Sometimes one editorial section should look different from the rest. Reviews might want a ratings grid. Editions might want a magazine-style cover. Events might want a calendar view. Project Broadsheet supports per-section layout overrides via directory data files, so you can change one section without forking the shared templates.
Create a custom layout
Copy the default article layout to a new file:
cp src/_includes/layouts/article.njk src/_includes/layouts/review-article.njk
Edit the new file to do whatever you want. Change the byline, add a ratings widget, reorder elements.
Assign the layout to a section
Create a directory data file at src/content/reviews/reviews.json:
{
"layout": "layouts/review-article.njk"
}
Every article in src/content/reviews/ now uses the new layout unless it overrides it in its own front matter. Articles in other sections are unaffected.
Override the section index
The section index page (the paginated list at /reviews/) is generated from a template at src/content/reviews/reviews-index.njk (or similar). To customize its layout:
- Open the section's index template.
- Change the
layoutfront matter or the markup inside. - Rebuild.
What to do next
- Custom layouts for the general layout system.
- Add a new section to create a new section from scratch.
- Template filters for reusable helpers.
Browse Support for community channels and paid support options, or book a call if you'd like me to set it up for you.