Use eleventyImport to control rebuilds of tag, blog, and feed pages
All checks were successful
Build and copy to prod / build-and-copy (push) Successful in 1m51s

This commit is contained in:
Lewis Dale 2024-04-11 07:03:25 +01:00
parent acdab8b321
commit 1584068b59
8 changed files with 22 additions and 2 deletions

View File

@ -5,6 +5,8 @@ pagination:
data: collections.posts
size: 5
reverse: true
eleventyImport:
collections: ["posts"]
---
<main class="wrapper-lg stack-xl">
<h1>Blog posts</h1>

View File

@ -14,6 +14,9 @@
"atom": "{{ page.url }}atom.xml",
"json": "{{ page.url }}feed.json"
}
},
"eleventyImport": {
"collections": ["tags", "posts"]
}
}
---

View File

@ -1,7 +1,10 @@
---json
{
"permalink": "atom.xml",
"eleventyExcludeFromCollections": true
"eleventyExcludeFromCollections": true,
"eleventyImport": {
"collections": ["posts"]
}
}
---
<?xml version="1.0" encoding="utf-8"?>

View File

@ -1,7 +1,10 @@
---json
{
"permalink": "feed.json",
"eleventyExcludeFromCollections": true
"eleventyExcludeFromCollections": true,
"eleventyImport": {
"collections": ["posts"]
}
}
---
{

View File

@ -1,6 +1,9 @@
---
permalink: /rss.xml
eleventyExcludeFromCollections: true
eleventyImport:
collections:
- posts
---
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:base="{{ metadata.site.url }}" xmlns:atom="http://www.w3.org/2005/Atom">

View File

@ -5,6 +5,8 @@ pagination:
alias: tag
eleventyComputed:
permalink: "/post/tag/{{ tag }}/atom.xml"
eleventyImport:
collections: ["posts", "tags"]
---
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:base="{{ metadata.site.url }}">

View File

@ -5,6 +5,8 @@ pagination:
alias: tag
eleventyComputed:
permalink: "/post/tag/{{ tag }}/feed.json"
eleventyImport:
collections: ["posts", "tags"]
---
{
"version": "https://jsonfeed.org/version/1.1",

View File

@ -5,6 +5,8 @@ pagination:
alias: tag
eleventyComputed:
permalink: "/post/tag/{{ tag }}/rss.xml"
eleventyImport:
collections: ["posts", "tags"]
---
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:base="{{ metadata.site.url }}" xmlns:atom="http://www.w3.org/2005/Atom">