Configuration
- sectionType: collection-list
collectionName: 'blog'
containerTag: section
disabled: false
id: ""
classes: ""
containerFields:
inContainer: false
isAnimated: true
noMargin:
top: true
bottom: false
noPadding:
top: false
bottom: false
background:
isDark: true
color: ""
image: ""
imageScreen: "none"
hasPagingParams: true
pagingParams:
numberOfBlogs: ""
numberOfPages: ""
pageLength: ""
pageStart: ""
pageNumber: ""
Configuration Options
Collection Settings
| Property | Type | Required | Description |
|---|
collectionName | string | Yes | Name of the collection to display ('blog', 'components', 'products', etc.) |
Pagination Settings
| Property | Type | Required | Description |
|---|
hasPagingParams | boolean | No | Enables pagination functionality |
pagingParams.numberOfBlogs | string | No | Total number of items (auto-populated) |
pagingParams.numberOfPages | string | No | Total pages needed (auto-populated) |
pagingParams.pageLength | string | No | Items per page (auto-populated) |
pagingParams.pageStart | string | No | Starting index for current page (auto-populated) |
pagingParams.pageNumber | string | No | Current page number (auto-populated) |
The component automatically includes author/date information if present in collection items.
Note: This component requires the metalsmith-sectioned-blog-pagination plugin to calculate and populate pagination parameters automatically.
Notes
About hasPagingParams
- Marks the target section: In templates with multiple sections, hasPagingParams: true identifies which specific section should receive the pagination metadata (page number, total pages, current list of posts).
- Validation requirement: The plugin requires at least one section with hasPagingParams: true in the main template file. If missing, it throws an error: "blog.md must contain a section with hasPagingParams: true" (src/index.js:50-51).
- Parameter injection point: When generating pagination pages, the plugin finds the section with hasPagingParams: true and injects the pagination parameters into that section's params object, including:
- pageNumber: Current page number
- numberOfPages: Total number of pages
- currentList: Array of blog posts for the current page
This allows the plugin to work with modular page builders where content is organized in sections, ensuring pagination data goes to the correct section rather than being added globally.
Blog Post Data Structure
Each blog post in the collection needs a card object for the blog-list component to render properly:
card:
title: 'Architecture Philosophy'
date: '2025-06-02'
author:
- Albert Einstein
- Isaac Newton
image: '/assets/images/sample9.jpg'
featuredBlogpost: true
featuredBlogpostOrder: 1
excerpt: |-
This starter embodies several key principles that make structured content management both powerful and approachable.
Option settings for the collections plugin determine the sort order of the cards. In metalsmith.js:
.use(
collections( {
blog: {
pattern: 'blog/*.md',
sortBy: 'card.date',
reverse: false
}
} )
)