Erlend's semi-curated nonsense

Simple Sitemap on Github pages

I was trying to get the jekyll-sitemap plugin to work on github pages, but I could not seem to get it to run.

So here is a very simple jekyll template that will generate a sitemap.xml file from your blog posts (not pages!)

layout: null
<?xml version="1.0" encoding="UTF-8"?>
<urlset xsi:schemaLocation="" xmlns:xsi="" xmlns="">
        <loc>{{ site.url }}{{ site.baseurl }}</loc>
        <lastmod>{{ site.time | date_to_xmlschema }}</lastmod>
    {% for post in site.posts %}
        <loc>{{ post.url | prepend: site.baseurl | prepend: site.url }}</loc>
        <lastmod>{{ | date_to_xmlschema }}</lastmod>
    {% endfor %}

And here is the resulting sitemap.xml file.

Similar Posts