
Research
/Security News
Malicious Chrome and Firefox Extensions Steal Crypto Traders’ Session and Wallet Data
Malicious Chrome and Firefox extensions target Axiom Trade and Padre users, stealing session tokens and wallet data.
eleventy-plugin-normalized-collections
Advanced tools
Eleventy plugin for normalized collections with flattened frontmatter and automatic navigation
Early Development Notice: This plugin is under active development. The API may change before reaching v1.0.0. Please report issues and feedback on GitHub.
Eleventy plugin for normalized collections with flattened frontmatter and automatic navigation. Creates collections that match component library expectations by bridging the gap between Eleventy's native collection format and component contracts.
.data)mainMenu collection from pages with navigation.navLabelnavigation.breadcrumbscard.date)permalink property for URL referencesnpm install eleventy-plugin-normalized-collections
Add the plugin to your Eleventy configuration:
// eleventy.config.js
import normalizedCollections from 'eleventy-plugin-normalized-collections';
export default function (eleventyConfig) {
eleventyConfig.addPlugin(normalizedCollections, {
collections: {
blog: {
glob: 'src/blog/*.md',
sortBy: 'card.date',
sortOrder: 'desc'
},
projects: {
glob: 'src/projects/*.md',
sortBy: 'title',
sortOrder: 'asc'
}
}
});
}
| Option | Type | Default | Description |
|---|---|---|---|
collections | object | {} | Collection configuration object |
Each collection accepts:
| Option | Type | Default | Description |
|---|---|---|---|
glob | string | Required | Glob pattern for source files |
sortBy | string | None | Dot-notation path to sort property |
sortOrder | string | 'asc' | Sort order: 'asc' or 'desc' |
Each item in a normalized collection includes:
{
// All frontmatter properties flattened to top level
title: 'My Blog Post',
card: { date: '2025-01-15', summary: '...' },
// Added by plugin
permalink: 'blog/my-post', // URL without leading/trailing slashes
url: '/blog/my-post/', // Original Eleventy URL
inputPath: './src/blog/my-post.md',
outputPath: './_site/blog/my-post/index.html',
fileSlug: 'my-post'
}
The plugin automatically creates a mainMenu collection from pages that have navigation.navLabel in their frontmatter:
# src/about.md
---
title: About Us
navigation:
navLabel: About
navIndex: 2
---
Access in templates:
{% for item in collections.mainMenu %}
<a href="{{ item.path }}">{{ item.title }}</a>
{% endfor %}
Menu items are sorted by navigation.navIndex (defaults to 999 if not specified).
The plugin adds computed data for navigating between collection items:
{# In a blog post template #}
{% if collection.blog.previous | length %}
<a href="/{{ collection.blog.previous[0].permalink }}">
Previous: {{ collection.blog.previous[0].title }}
</a>
{% endif %}
{% if collection.blog.next | length %}
<a href="/{{ collection.blog.next[0].permalink }}">
Next: {{ collection.blog.next[0].title }}
</a>
{% endif %}
For descending date order (newest first):
previous = older post (published earlier)next = newer post (published later)Breadcrumbs are automatically generated for all pages:
<nav aria-label="Breadcrumb">
<ol>
{% for crumb in navigation.breadcrumbs %}
<li>
<a href="{{ crumb.path }}">{{ crumb.title }}</a>
</li>
{% endfor %}
</ol>
</nav>
Breadcrumbs use titles from mainMenu when available, otherwise derive titles from URL segments.
Example output for /blog/my-post/:
[
{ title: 'Home', path: '/' },
{ title: 'Blog', path: '/blog/' },
{ title: 'My Post', path: '/blog/my-post/' }
];
For pages using Eleventy's built-in pagination, the plugin computes pagingParams with template-friendly values. Add pagination to your content file frontmatter:
# src/blog.md
---
layout: sections.njk
permalink: /blog/{% if pagination.pageNumber > 0 %}{{ pagination.pageNumber }}/{% endif %}
pagination:
data: collections.blog
size: 10
sections:
- container: section
name: collection-list
hasPagingParams: true
collectionName: blog
---
The plugin computes these values automatically:
| Property | Description |
|---|---|
numberOfItems | Total items in the collection |
numberOfPages | Total number of pagination pages |
pageLength | Items per page (from pagination.size) |
pageStart | Index of first item on current page |
pageNumber | Current page number (1-indexed) |
Access in templates:
{# Display pagination info #}
<p>Showing {{ pagingParams.pageLength }} of {{ pagingParams.numberOfItems }} posts</p>
<p>Page {{ pagingParams.pageNumber }} of {{ pagingParams.numberOfPages }}</p>
{# Build pagination links #}
{% if pagingParams.numberOfPages > 1 %}
<nav aria-label="Pagination">
{% for i in range(1, pagingParams.numberOfPages + 1) %}
<a href="/blog/{% if i > 1 %}{{ i - 1 }}/{% endif %}">{{ i }}</a>
{% endfor %}
</nav>
{% endif %}
Note: pagingParams is only populated on pages that have Eleventy pagination configured. For non-paginated pages, it returns null.
The plugin supports sorting by any nested property using dot notation:
{
collections: {
blog: {
glob: 'src/blog/*.md',
sortBy: 'card.date', // Nested property
sortOrder: 'desc'
},
alphabetical: {
glob: 'src/pages/*.md',
sortBy: 'title', // Top-level property
sortOrder: 'asc'
}
}
}
Sorting handles:
MIT
Portions of this project were developed with the assistance of AI tools including Claude and Claude Code. These tools were used to:
All AI-assisted code has been reviewed and tested to ensure it meets project standards.
FAQs
Eleventy plugin for normalized collections with flattened frontmatter and automatic navigation
We found that eleventy-plugin-normalized-collections demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Research
/Security News
Malicious Chrome and Firefox extensions target Axiom Trade and Padre users, stealing session tokens and wallet data.

Security News
GPT-6 Astra hits 100% on ExploitBench and finds zero-days autonomously, while independent tests reveal scope violations and monitoring gaps.

Product
Socket can now send alerts and supply chain attack notifications to Microsoft Teams, with filters that route the right updates to each channel.