From d2439adf61b865d319137d7713e0abce17988ab3 Mon Sep 17 00:00:00 2001 From: Zach Leatherman Date: Thu, 4 Apr 2019 20:49:20 -0500 Subject: [PATCH] Use new eleventyExcludeFromCollections feature in 0.8.0: https://www.11ty.io/docs/collections/#option%3A-exclude-content-from-collections --- 404.md | 2 +- feed/feed.njk | 2 +- feed/htaccess.njk | 2 +- sitemap.xml.njk | 4 +--- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/404.md b/404.md index f45f7c1..2beb8b7 100644 --- a/404.md +++ b/404.md @@ -1,7 +1,7 @@ --- layout: layouts/home.njk permalink: 404.html -excludeFromSitemap: true +eleventyExcludeFromCollections: true --- # Content not found. diff --git a/feed/feed.njk b/feed/feed.njk index f889671..5711fe1 100644 --- a/feed/feed.njk +++ b/feed/feed.njk @@ -1,6 +1,6 @@ --- permalink: feed/feed.xml -excludeFromSitemap: true +eleventyExcludeFromCollections: true --- diff --git a/feed/htaccess.njk b/feed/htaccess.njk index 8b4e0d9..ac4a3c5 100644 --- a/feed/htaccess.njk +++ b/feed/htaccess.njk @@ -1,6 +1,6 @@ --- permalink: feed/.htaccess -excludeFromSitemap: true +eleventyExcludeFromCollections: true --- # For Apache, to show `{{ metadata.feed.filename }}` when browsing to directory /feed/ (hide the file!) DirectoryIndex {{ metadata.feed.filename }} diff --git a/sitemap.xml.njk b/sitemap.xml.njk index d1745a3..0a74480 100644 --- a/sitemap.xml.njk +++ b/sitemap.xml.njk @@ -1,16 +1,14 @@ --- permalink: /sitemap.xml -excludeFromSitemap: true +eleventyExcludeFromCollections: true --- {%- for page in collections.all %} -{%- if not page.data.excludeFromSitemap %} {% set absoluteUrl %}{{ page.url | url | absoluteUrl(metadata.url) }}{% endset %} {{ absoluteUrl }} {{ page.date | htmlDateString }} -{%- endif %} {%- endfor %}