mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-13 16:14:05 +00:00
fix: inclusion of null locs in sitemap.xml
Impacted by Hugo changes Fix #2732
This commit is contained in:
1 parent
d0aac60634
commit
d26624902d
1 file changed
+1
-1
@@ -2,7 +2,7 @@
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
|
||||
xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
||||
{{/* Check that page is built (has a URL) and is not private. */}}
|
||||
{{ range where (where .Data.Pages "Permalink" "!=" nil) "Params.private" "ne" true }}
|
||||
{{ range where (where .Data.Pages "Permalink" "!=" "") "Params.private" "ne" true }}
|
||||
<url>
|
||||
<loc>{{ .Permalink }}</loc>
|
||||
{{- if not .Lastmod.IsZero }}<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}
|
||||
|
||||
Reference in new issue
Block a user