Section Component
Collection Links
A navigation component that provides previous and next links between sequential collection items. This component automatically integrates with Metalsmith's collections plugin to display contextual navigation at the end of collection articles.
How It Works
The component uses the collectionName property to determine which collection to navigate. This defaults to 'blog' if not specified, making it backwards compatible while allowing use with any named collection.
It reads previous and next variables that are automatically populated by Metalsmith's collections plugin when processing collection items. The component only renders when a page has previous or next items available, making it safe to include in any collection item template.
Live Example
To see this component in action, visit any blog post on this site. For example, check the bottom of theSample Blog Postto see the previous and next navigation links.