fix: include content/pages/*.md in pages collection

This commit is contained in:
Ricardo
2026-02-02 12:03:30 +01:00
parent e657aa5a72
commit a148a90cc7
+6 -4
View File
@@ -340,11 +340,13 @@ export default function (eleventyConfig) {
});
// Pages collection - root-level slash pages (about, now, uses, etc.)
// These are stored directly in content/ root (not in subdirectories)
// Created via Indiekit's page post type with path: "{slug}.md"
// Includes both content/*.md (legacy) and content/pages/*.md (new post-type-page)
// Created via Indiekit's page post type
eleventyConfig.addCollection("pages", function (collectionApi) {
return collectionApi
.getFilteredByGlob("content/*.md")
const rootPages = collectionApi.getFilteredByGlob("content/*.md");
const pagesDir = collectionApi.getFilteredByGlob("content/pages/*.md");
return [...rootPages, ...pagesDir]
.filter(page => !page.inputPath.includes('content.json') && !page.inputPath.includes('pages.json'))
.sort((a, b) => (a.data.title || a.data.name || "").localeCompare(b.data.title || b.data.name || ""));
});