Created
July 11, 2014 15:14
-
-
Save matijs/13c2c1f8856fd3d4906e to your computer and use it in GitHub Desktop.
Jekyll sitemap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
layout: none | |
--- | |
<?xml version="1.0" encoding="UTF-8"?> | |
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> | |
{% for post in site.posts %}{% unless post.unpublished == false %}<url> | |
<loc>{{ site.url }}{{ post.url }}</loc> | |
<lastmod>{% if post.sitemap.lastmod %}{{ post.sitemap.lastmod | date: "%Y-%m-%d" }}{% else %}{{ post.date | date_to_xmlschema }}{% endif %}</lastmod>{% if post.sitemap.changefreq %} | |
<changefreq>{{ post.sitemap.changefreq }}</changefreq>{% endif %}{% if post.sitemap.priority %} | |
<priority>{{ post.sitemap.priority }}</priority>{% endif %} | |
</url>{% endunless %}{% endfor %} | |
{% for page in site.pages %}{% if page.sitemap != null %}<url> | |
<loc>{{ site.url }}{{ page.url | replace: 'index.html', '' }}</loc>{% if page.sitemap.changefreq %} | |
<changefreq>{{ page.sitemap.changefreq }}</changefreq>{% endif %}{% if page.sitemap.priority %} | |
<priority>{{ page.sitemap.priority }}</priority>{% endif %} | |
</url>{% endif %}{% endfor %} | |
</urlset> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment