Skip to content

Commit 37b97ed

Browse files
authored
Merge pull request mendix#7458 from mendix/MvM-ReduceSiteMap
Remove old versions from Sitemap
2 parents a272560 + d2ddeef commit 37b97ed

File tree

7 files changed

+33
-0
lines changed

7 files changed

+33
-0
lines changed

content/en/docs/howto7/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ cascade:
1212
- banner: "Mendix 7 is no longer supported unless you have Extended Support (for details, please contact Mendix Support). Mendix 7 documentation will remain available for customers with Extended Support until July, 2024."
1313
- old_content: true
1414
- hide_feedback: true
15+
- notsitemap: true
1516
- sitemap:
1617
priority: 0.1
1718
---

content/en/docs/howto8/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ cascade:
1111
- mendix_version: 8
1212
- old_content: true
1313
- hide_feedback: true
14+
- notsitemap: true
1415
- sitemap:
1516
priority: 0.2
1617
#This document is mapped to the landing page, update the link there if renaming or moving the doc file.

content/en/docs/howto9/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ cascade:
1010
- space: "Studio Pro 9 How-tos"
1111
- mendix_version: 9
1212
- old_content: true
13+
- notsitemap: true
1314
- sitemap:
1415
priority: 0.3
1516
#This document is mapped to the landing page, update the link there if renaming or moving the doc file.

content/en/docs/refguide7/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ cascade:
1212
- banner: "Mendix 7 is no longer supported unless you have Extended Support (for details, please contact Mendix Support). Mendix 7 documentation will remain available for customers with Extended Support until July, 2024."
1313
- old_content: true
1414
- hide_feedback: true
15+
- notsitemap: true
1516
- sitemap:
1617
priority: 0.1
1718
---

content/en/docs/refguide8/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ cascade:
1111
- mendix_version: 8
1212
- old_content: true
1313
- hide_feedback: true
14+
- notsitemap: true
1415
- sitemap:
1516
priority: 0.3
1617
---

content/en/docs/refguide9/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ cascade:
1010
- space: "Studio Pro 9 Guide"
1111
- mendix_version: 9
1212
- old_content: true
13+
- notsitemap: true
1314
- sitemap:
1415
priority: 0.4
1516
---

layouts/_default/sitemap.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
2+
<!-- Updated to exclude pages which have the front matter sitemapexclude: true - can then exclude all but the latest version see https://dereckcurry.com/posts/excluding-pages-from-the-sitemap/ -->
3+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
4+
xmlns:xhtml="http://www.w3.org/1999/xhtml">
5+
{{ range .Data.Pages }}
6+
{{- if .Permalink -}}
7+
{{- if or (eq (isset .Params "notsitemap") false) (ne .Params.notsitemap true) -}}
8+
<url>
9+
<loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
10+
<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
11+
<changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
12+
<priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
13+
<xhtml:link
14+
rel="alternate"
15+
hreflang="{{ .Language.LanguageCode }}"
16+
href="{{ .Permalink }}"
17+
/>{{ end }}
18+
<xhtml:link
19+
rel="alternate"
20+
hreflang="{{ .Language.LanguageCode }}"
21+
href="{{ .Permalink }}"
22+
/>{{ end }}
23+
</url>
24+
{{- end -}}
25+
{{- end -}}
26+
{{ end }}
27+
</urlset>

0 commit comments

Comments
 (0)