Skip to content

Commit

Permalink
docs: update sitemap template (#39819)
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Mar 25, 2024
1 parent 11037f8 commit 9480a3d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion site/content/404.md
Expand Up @@ -4,7 +4,8 @@ layout: 404
description: ""
url: /404.html
robots: noindex,follow
sitemap_exclude: true
sitemap:
exclude: true
---

<div class="text-center py-5">
Expand Down
3 changes: 2 additions & 1 deletion site/content/docs/5.3/_index.html
@@ -1,5 +1,6 @@
---
layout: redirect
sitemap_exclude: true
sitemap:
exclude: true
redirect: "/docs/5.3/getting-started/introduction/"
---
3 changes: 2 additions & 1 deletion site/content/docs/5.3/docsref.md
Expand Up @@ -5,7 +5,8 @@ description: Examples of Bootstrap's documentation-specific components and style
aliases: "/docsref/"
toc: true
robots: noindex,follow
sitemap_exclude: true
sitemap:
exclude: true
---

## Buttons
Expand Down
3 changes: 2 additions & 1 deletion site/content/docs/_index.html
@@ -1,5 +1,6 @@
---
layout: redirect
sitemap_exclude: true
sitemap:
exclude: true
redirect: "/docs/5.3/getting-started/introduction/"
---
6 changes: 3 additions & 3 deletions site/layouts/sitemap.xml
@@ -1,12 +1,12 @@
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
{{- range .Data.Pages -}}{{ if and .Permalink (ne .Params.sitemap_exclude true) }}
{{- range where .Data.Pages "Params.sitemap.exclude" "ne" true -}}{{ if .Permalink }}
<url>
<loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
<lastmod>{{ safeHTML (.Lastmod.Format "2006-01-02T15:04:05-07:00") }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
<changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
<priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
<xhtml:link rel="alternate" hreflang="{{ .Language.Lang }}" href="{{ .Permalink }}"/>{{ end }}
<xhtml:link rel="alternate" hreflang="{{ .Language.Lang }}" href="{{ .Permalink }}"/>{{ end }}
<xhtml:link rel="alternate" hreflang="{{ .Language.LanguageCode }}" href="{{ .Permalink }}"/>{{ end }}
<xhtml:link rel="alternate" hreflang="{{ .Language.LanguageCode }}" href="{{ .Permalink }}"/>{{ end }}
</url>{{ end }}{{ end }}
</urlset>

0 comments on commit 9480a3d

Please sign in to comment.