Pages as Structured Data
Pages are built by defining a content model in the frontmatter. Each page specifies its layout template and an array of section components. The layout template orchestrates these sections while individual component files handle specific rendering logic.
This page demonstrates the component-based approach:
layout: pages/sections.njk
bodyClasses: 'sections-page'
hasHero: true
navigation:
navLabel: 'Home'
navIndex: 0
seo:
title: Metalsmith Components
description: 'A collection of section components for use with Metalsmith'
socialImage: '/assets/images/sample2.jpg'
canonicalURL: ''
sections:
- sectionType: hero
# hero configuration
- sectionType: text-only
# text-only configuration
- sectionType: media-image
# media-image configuration
Configuration Properties:
layoutdetermines the template file for page renderingbodyClassesadds CSS classes to the body elementnavigationdefines menu label and positionseocontains metadata for search engine optimizationsectionsarray defines the sequence of components to render