-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsitemap.xml
36 lines (35 loc) · 1.06 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
35
36
---
layout: null
include_in_sitemap: false
---
<?xml version="1.0" encoding="UTF-8" ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
{%
assign everything = site.posts
| concat: site.pages
| where: "include_in_sitemap", true
| where: "redirect", false
%}
{% for page in everything %}
<url>
<loc>{{ page.url | absolute_url }}</loc>
{% if page.last_modified_at %}
<lastmod>{{ page.last_modified_at | date_to_xmlschema }}</lastmod>
{% else %}
<lastmod>{{ page.date | date_to_xmlschema }}</lastmod>
{% endif %}
{% assign translations = everything | where: "ref", page.ref %}
{% for translation in translations %}
<xhtml:link
rel="alternate"
{% if translation.lang %}
hreflang="{{ translation.lang }}"
{% else %}
hreflang="x-default"
{% endif %}
href="{{ translation.url | absolute_url }}"
/>
{% endfor %}
</url>
{% endfor %}
</urlset>