Add sitemap

This commit is contained in:
Lewis Dale 2023-11-28 20:52:20 +00:00
parent 050fdc46b2
commit b0bc736a7e
2 changed files with 36 additions and 0 deletions

View File

@ -1,3 +1,5 @@
Sitemap: https://lewisdale.dev/sitemap.xml
User-Agent: Bytespider User-Agent: Bytespider
Disallow: / Disallow: /

34
src/sitemap.njk Normal file
View File

@ -0,0 +1,34 @@
---
permalink: /sitemap.xml
---
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://{{ metadata.site.domain }}/</loc>
<priority>1.0</priority>
</url>
<url>
<loc>https://{{ metadata.site.domain }}/now/</loc>
</url>
<url>
<loc>https://{{ metadata.site.domain }}/blog/</loc>
<priority>0.8</priority>
</url>
<url>
<loc>https://{{ metadata.site.domain }}/links/</loc>
</url>
<url>
<loc>https://{{ metadata.site.domain }}/user-manual.html</loc>
</url>
{% for tag in tags %}
<url>
<loc>https://{{ metadata.site.domain }}/post/tag/{{ tag.slug }}/</loc>
</url>
{% endfor %}
{% for post in posts %}
<url>
<loc>https://{{ metadata.site.domain }}/post/{{ post.slug }}/</loc>
<lastmod>{{ post.date }}Z</lastmod>
</url>
{% endfor %}
</urlset>