From f82d65930b8e40766c5e43245180d21a570a1e72 Mon Sep 17 00:00:00 2001 From: Cassie Jones Date: Fri, 4 Oct 2024 00:59:02 -0700 Subject: [PATCH] Add eleventyImport annotations to fix build order --- archive.njk | 2 ++ feed.njk | 7 +++++++ index.njk | 2 ++ webrings.njk | 2 ++ years.njk | 2 ++ 5 files changed, 15 insertions(+) diff --git a/archive.njk b/archive.njk index d025974..d1c758e 100644 --- a/archive.njk +++ b/archive.njk @@ -1,6 +1,8 @@ --- layout: "layouts/layout.njk" title: "Archive" +eleventyImport: + collections: ["posts"] --- {% for year, group in collections.posts | reverse | groupby("date.getFullYear()") %} diff --git a/feed.njk b/feed.njk index f502150..2ecc63b 100644 --- a/feed.njk +++ b/feed.njk @@ -1,5 +1,12 @@ --- permalink: feed.xml +# The excludeFromCollections seems to be necessary here to avoid "tried to use templateContent too early" but I don't know why +# This doesn't seem like it should be necessary, but I get issues with `serve` when I don't have it +# From https://github.com/11ty/eleventy/issues/3136 +eleventyExcludeFromCollections: + collections: ["posts"] +eleventyImport: + collections: ["posts"] metadata: title: Witch of Light url: https://blog.witchoflight.com/ diff --git a/index.njk b/index.njk index 371c472..785ef33 100644 --- a/index.njk +++ b/index.njk @@ -1,5 +1,7 @@ --- layout: "layouts/layout.njk" +eleventyImport: + collections: ["posts"] ---