Skip to content

Instantly share code, notes, and snippets.

@redVi
Created February 19, 2014 16:49
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save redVi/9096116 to your computer and use it in GitHub Desktop.
Save redVi/9096116 to your computer and use it in GitHub Desktop.
sitemap of jekyll blog
---
layout: none
sitemap:
priority: 1.0
changefreq: weekly
---
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{% for post in site.posts %}
<url>
<loc>{{ site.url }}{{ post.url }}</loc>
{% if post.lastmod == null %}
<lastmod>{{ post.date | date: "%Y-%m-%d" }}</lastmod>
{% else %}
<lastmod>{{ post.lastmod | date: "%Y-%m-%d" }}</lastmod>
{% endif %}
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
{% endfor %}
{% for page in site.pages %}
{% if page.sitemap != null and page.sitemap != empty %}
<url>
<loc>{{ site.url }}{{ page.url }}</loc>
<changefreq>{{ page.sitemap.changefreq }}</changefreq>
<priority>{{ page.sitemap.priority }}</priority>
</url>
{% endif %}
{% endfor %}
</urlset>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment