Re-add XML Sitemap

This commit is contained in:
Oliver Davies 2021-07-19 08:11:30 +01:00
parent a174d42187
commit b5db766387
3 changed files with 46 additions and 0 deletions

View file

@ -1,6 +1,7 @@
---
title: Page not found
permalink: /404.html
exclude_from_sitemap: true
---
{% block javascripts %}

View file

@ -2,6 +2,7 @@
title: Oliver Davies - UK-based Lead Software Developer, PHP and Drupal specialist
permalink: /
is_front: true
exclude_from_sitemap: true
---
<div class="markdown" markdown="1">

44
source/sitemap.xml.twig Normal file
View file

@ -0,0 +1,44 @@
---
permalink: sitemap.xml
use:
- pages
- posts
- talks
---
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>{{ site.url }}</loc>
<lastmod>{{ site.calculated_date|date('Y-m-d') }}</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
{% for page in data.pages if not page.exclude_from_sitemap %}
<url>
<loc>{{ site.url }}{{ page.url }}</loc>
<lastmod>{{ site.calculated_date|date('Y-m-d') }}</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
{% endfor %}
{% for post in data.posts %}
<url>
<loc>{{ site.url }}{{ post.url }}</loc>
<lastmod>{{ post.date|date('c') }}</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
{% endfor %}
{% for talk in data.talks if not talk.hide_page %}
<url>
<loc>{{ site.url }}{{ talk.url }}</loc>
<lastmod>{{ talk.date|date('c') }}</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
{% endfor %}
</urlset>