]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Update Hugo config and sitemap.xml (#34074)
authorXhmikosR <xhmikosr@gmail.com>
Tue, 25 May 2021 05:32:27 +0000 (08:32 +0300)
committerXhmikosR <xhmikosr@gmail.com>
Wed, 21 Jul 2021 13:20:01 +0000 (16:20 +0300)
config.yml
site/layouts/sitemap.xml

index a39dda368e7a523a69f0224e4928dbd8fa60d7e5..f072f329f4972c13eb68ab497167d2369666b43b 100644 (file)
@@ -18,7 +18,7 @@ buildFuture:            true
 
 enableRobotsTXT:        true
 metaDataFormat:         "yaml"
-disableKinds:           ["404", "taxonomy", "taxonomyTerm", "RSS"]
+disableKinds:           ["404", "taxonomy", "term", "RSS"]
 
 publishDir:             "_site"
 
index 972ebf6a54fd65a7932238010d93050740ac01e1..869f1cbe86e41418c37f67879ea41ba982f1235e 100644 (file)
@@ -1,10 +1,12 @@
-{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
+{{ 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 ne .Params.sitemap_exclude true }}
+  {{- range .Data.Pages -}}{{ if and .Permalink (ne .Params.sitemap_exclude true) }}
   <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 }}
+    <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 }}
   </url>{{ end }}{{ end }}
 </urlset>