-
Notifications
You must be signed in to change notification settings - Fork 4
/
sitemap.xml
34 lines (34 loc) · 1.48 KB
/
sitemap.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
---
layout: null
permalink: /sitemap.xml
sitemap: false
---
<?xml version="1.0" encoding="UTF-8"?>
{% if page.xsl %}
<?xml-stylesheet type="text/xsl" href="{{ "/sitemap.xsl" | absolute_url }}"?>
{% endif %}
<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" xmlns:xhtml="http://www.w3.org/1999/xhtml">
{% assign posts = site.posts | where_exp:'post','post.sitemap != false' %}
{% for post in posts %}
<url>
<loc>{{ post.url | absolute_url | xml_escape }}</loc>
{% assign versions = site.posts | where:"ref", post.ref %}
{% for version in versions %}
<xhtml:link rel="alternate" hreflang="{{ version.lang }}" href="{{ version.url | absolute_url | xml_escape }}" />
{% endfor %}
<lastmod>{{ post.date | date_to_xmlschema }}</lastmod>
<changefreq>weekly</changefreq>
</url>
{% endfor %}
{% assign pages = site.pages | where_exp:'page','page.sitemap != false' %}
{% for page in pages %}
<url>
<loc>{{ page.url | absolute_url | xml_escape }}</loc>
{% assign versions = site.pages | where:"ref", page.ref %}
{% for version in versions %}
<xhtml:link rel="alternate" hreflang="{{ version.lang }}" href="{{ version.url | absolute_url | xml_escape }}" />
{% endfor %}
<changefreq>weekly</changefreq>
</url>
{% endfor %}
</urlset>