feat: revise robots.txt and sitemap.xml functions

This commit is contained in:
Devin Haska 2024-03-13 16:23:50 -07:00
parent e81263efb9
commit 27447d2343
5 changed files with 11 additions and 1 deletions

View file

@ -5,9 +5,11 @@ 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 %}
<url>
<loc>{{ site.url }}{{ page.url | url }}</loc>
<lastmod>{{ page.date.toISOString() }}</lastmod>
</url>
{% endif %}
{% endfor %}
</urlset>