Skip to content

Commit

Permalink
Use new eleventyExcludeFromCollections feature in 0.8.0: https://www.…
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat committed Apr 5, 2019
1 parent c700f09 commit d2439ad
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion 404.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: layouts/home.njk
permalink: 404.html
excludeFromSitemap: true
eleventyExcludeFromCollections: true
---
# Content not found.

Expand Down
2 changes: 1 addition & 1 deletion feed/feed.njk
Original file line number Diff line number Diff line change
@@ -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">
Expand Down
2 changes: 1 addition & 1 deletion feed/htaccess.njk
Original file line number Diff line number Diff line change
@@ -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 }}
4 changes: 1 addition & 3 deletions sitemap.xml.njk
Original file line number Diff line number Diff line change
@@ -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>

0 comments on commit d2439ad

Please sign in to comment.