-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsitemap.xml
More file actions
58 lines (57 loc) · 2.21 KB
/
Copy pathsitemap.xml
File metadata and controls
58 lines (57 loc) · 2.21 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
layout: null
---
<?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">
{% assign product_pages = "/opendj,/openam,/openig,/openicf,/openidm" | split: "," %}
{% assign key_pages = "/support,/forgerock-alternative" | split: "," %}
{% assign priority_pages = product_pages | concat: key_pages %}
{% for post in site.posts %}
<url>
<loc>{{ site.url }}{{ post.url }}</loc>
{% if post.lastmod %}
<lastmod>{{ post.lastmod | date_to_xmlschema }}</lastmod>
{% else %}
<lastmod>{{ post.date | date_to_xmlschema }}</lastmod>
{% endif %}
{% assign now_ts = "now" | date: "%s" | times: 1 %}
{% assign post_ts = post.date | date: "%s" | times: 1 %}
{% assign days_since_post = now_ts | minus: post_ts | divided_by: 86400 %}
{% if days_since_post < 90 %}
<changefreq>weekly</changefreq>
{% else %}
<changefreq>monthly</changefreq>
{% endif %}
<priority>0.8</priority>
</url>
{% endfor %}
{% for page in site.pages %}
{% if page.layout != null and page.layout != empty and page.layout != "redirect" %}
<url>
<loc>{{ site.url }}{{ page.url | remove: "index.html" | remove: ".html" }}</loc>
{% if page.lastmod %}
<lastmod>{{ page.lastmod | date_to_xmlschema }}</lastmod>
{% endif %}
{% if page.url == "/" %}
<changefreq>weekly</changefreq>
<priority>1.0</priority>
{% elsif priority_pages contains page.url %}
<changefreq>monthly</changefreq>
<priority>0.9</priority>
{% else %}
<changefreq>monthly</changefreq>
<priority>0.5</priority>
{% endif %}
</url>
{% endif %}
{% endfor %}
{% for file in site.static_files %}
{% if file.name == "index.html" %}
<url>
<loc>{{ site.url }}{{ file.path | remove: "index.html" | remove: ".html" }}</loc>
<changefreq>monthly</changefreq>
<priority>0.5</priority>
</url>
{% endif %}
{% endfor %}
</urlset>