From a148a90cc7486cac94d9228faad52758ab69ce1c Mon Sep 17 00:00:00 2001 From: Ricardo Date: Mon, 2 Feb 2026 12:03:30 +0100 Subject: [PATCH] fix: include content/pages/*.md in pages collection --- eleventy.config.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/eleventy.config.js b/eleventy.config.js index c314c80..bccd5c3 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -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 || "")); });