Use new eleventyExcludeFromCollections feature in 0.8.0: https://www.11ty.io/docs/collections/#option%3A-exclude-content-from-collections
This commit is contained in:
parent
c700f094a6
commit
d2439adf61
2
404.md
2
404.md
@ -1,7 +1,7 @@
|
||||
---
|
||||
layout: layouts/home.njk
|
||||
permalink: 404.html
|
||||
excludeFromSitemap: true
|
||||
eleventyExcludeFromCollections: true
|
||||
---
|
||||
# Content not found.
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
permalink: feed/feed.xml
|
||||
excludeFromSitemap: true
|
||||
eleventyExcludeFromCollections: true
|
||||
---
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||
|
@ -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 }}
|
||||
|
@ -1,16 +1,14 @@
|
||||
---
|
||||
permalink: /sitemap.xml
|
||||
excludeFromSitemap: true
|
||||
eleventyExcludeFromCollections: true
|
||||
---
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
{%- for page in collections.all %}
|
||||
{%- if not page.data.excludeFromSitemap %}
|
||||
{% set absoluteUrl %}{{ page.url | url | absoluteUrl(metadata.url) }}{% endset %}
|
||||
<url>
|
||||
<loc>{{ absoluteUrl }}</loc>
|
||||
<lastmod>{{ page.date | htmlDateString }}</lastmod>
|
||||
</url>
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
</urlset>
|
||||
|
Loading…
Reference in New Issue
Block a user