fix: declare collection dependencies for incremental builds
Add eleventyImport.collections to templates that access collections via Nunjucks loops (not pagination frontmatter). Without this, Eleventy's --incremental mode skips these pages when content changes. - index.njk: posts, feed (homepage recent posts widget) - feed.njk: feed (RSS must update with new posts) - feed-json.njk: feed (JSON feed must update with new posts) - slashes.njk: pages (slash pages index) - categories-index.njk: categories (categories index)
This commit is contained in:
@@ -3,6 +3,9 @@ layout: layouts/base.njk
|
||||
title: Categories
|
||||
withSidebar: true
|
||||
permalink: categories/
|
||||
eleventyImport:
|
||||
collections:
|
||||
- categories
|
||||
---
|
||||
<div>
|
||||
<h1 class="text-2xl sm:text-3xl font-bold text-surface-900 dark:text-surface-100 mb-2">Categories</h1>
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
---
|
||||
permalink: /feed.json
|
||||
eleventyExcludeFromCollections: true
|
||||
eleventyImport:
|
||||
collections:
|
||||
- feed
|
||||
---
|
||||
{
|
||||
"version": "https://jsonfeed.org/version/1.1",
|
||||
|
||||
3
feed.njk
3
feed.njk
@@ -1,6 +1,9 @@
|
||||
---
|
||||
permalink: /feed.xml
|
||||
eleventyExcludeFromCollections: true
|
||||
eleventyImport:
|
||||
collections:
|
||||
- feed
|
||||
---
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/">
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
---
|
||||
layout: layouts/home.njk
|
||||
title: Home
|
||||
eleventyImport:
|
||||
collections:
|
||||
- posts
|
||||
- feed
|
||||
---
|
||||
|
||||
@@ -3,6 +3,9 @@ layout: layouts/base.njk
|
||||
title: Slash Pages
|
||||
withSidebar: true
|
||||
permalink: /slashes/
|
||||
eleventyImport:
|
||||
collections:
|
||||
- pages
|
||||
---
|
||||
<div class="h-feed">
|
||||
<h1 class="text-2xl sm:text-3xl font-bold text-surface-900 dark:text-surface-100 mb-2">Slash Pages</h1>
|
||||
|
||||
Reference in New Issue
Block a user