Add sitemap for SEO optimization

This commit is contained in:
Ole Eskild Steensen 2022-11-30 21:19:12 +01:00 committed by GitHub
parent d878c77e28
commit e61261eaae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

15
src/site/sitemap.njk Normal file
View File

@ -0,0 +1,15 @@
---
permalink: /sitemap.xml
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 page.url !== '/netlify/functions/search/data.json'%}
<url>
<loc>{{ site.url }}{{ page.url | url }}</loc>
<lastmod>{{ page.date.toISOString() }}</lastmod>
</url>
{%endif%}
{% endfor %}
</urlset>