Repository navigation
Expand file tree
/
Copy pathsitemap.xml
More file actions
41 lines (39 loc) · 1.63 KB
/
Copy pathsitemap.xml
File metadata and controls
41 lines (39 loc) · 1.63 KB
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
37
38
39
40
41
---
layout: null
sitemap: false
---
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{%- comment -%} Static pages (index, /blog/, /portfolio/ and their /pt/ versions) {%- endcomment -%}
{%- assign pages = site.pages | where_exp: "p", "p.sitemap != false" | sort: "url" -%}
{%- for pg in pages -%}
{%- unless pg.url contains ".xml" or pg.url contains ".txt" or pg.url contains ".json" -%}
<url>
<loc>{{ pg.url | replace: 'index.html', '' | absolute_url }}</loc>
<lastmod>{{ site.time | date_to_xmlschema }}</lastmod>
<changefreq>{% if pg.url == '/' or pg.url == '/pt/' %}monthly{% else %}weekly{% endif %}</changefreq>
<priority>{% if pg.url == '/' %}1.0{% elsif pg.url == '/pt/' %}0.9{% else %}0.8{% endif %}</priority>
</url>
{%- endunless -%}
{%- endfor -%}
{%- comment -%} Portfolio case studies {%- endcomment -%}
{%- assign projects = site.portfolio | where_exp: "p", "p.sitemap != false" | sort: "order" -%}
{%- for project in projects %}
<url>
<loc>{{ project.url | absolute_url }}</loc>
<lastmod>{{ project.last_modified_at | default: site.time | date_to_xmlschema }}</lastmod>
<changefreq>monthly</changefreq>
<priority>0.7</priority>
</url>
{%- endfor -%}
{%- comment -%} Blog posts {%- endcomment -%}
{%- assign posts = site.posts | where_exp: "p", "p.sitemap != false" -%}
{%- for post in posts %}
<url>
<loc>{{ post.url | absolute_url }}</loc>
<lastmod>{{ post.last_modified_at | default: post.date | date_to_xmlschema }}</lastmod>
<changefreq>yearly</changefreq>
<priority>0.6</priority>
</url>
{%- endfor %}
</urlset>