diff options
author | XhmikosR <xhmikosr@gmail.com> | 2021-05-25 08:32:27 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2021-07-21 16:20:01 +0300 |
commit | c272eb80bf320140de2f949635d271e376c82890 (patch) | |
tree | 25494c9fe77b8ad054da182ac4d7b2f0a6578233 | |
parent | ca3ff6dc29df09bb77321eacfb072be8c48c0c54 (diff) |
Update Hugo config and sitemap.xml (#34074)
-rw-r--r-- | config.yml | 2 | ||||
-rw-r--r-- | site/layouts/sitemap.xml | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/config.yml b/config.yml index a39dda368e..f072f329f4 100644 --- a/config.yml +++ b/config.yml @@ -18,7 +18,7 @@ buildFuture: true enableRobotsTXT: true metaDataFormat: "yaml" -disableKinds: ["404", "taxonomy", "taxonomyTerm", "RSS"] +disableKinds: ["404", "taxonomy", "term", "RSS"] publishDir: "_site" diff --git a/site/layouts/sitemap.xml b/site/layouts/sitemap.xml index 972ebf6a54..869f1cbe86 100644 --- a/site/layouts/sitemap.xml +++ b/site/layouts/sitemap.xml @@ -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> |