feat: enhance sitemap by excluding some pages
All checks were successful
Blog Deployment / check-rebuild (push) Successful in 5s
Blog Deployment / build (push) Has been skipped
Blog Deployment / deploy-staging (push) Successful in 10s
Blog Deployment / test-staging (push) Successful in 2s
Blog Deployment / merge (push) Successful in 7s
Blog Deployment / deploy-production (push) Successful in 9s
Blog Deployment / test-production (push) Successful in 3s
Blog Deployment / clean (push) Has been skipped

This commit is contained in:
Vezpi 2025-06-05 07:20:08 +00:00
parent c7164b4575
commit 805d834063
2 changed files with 12 additions and 9 deletions

View File

@ -117,6 +117,7 @@ params:
mainSections: ["post"]
description: "A blog documenting my homelab journey, covering automation, self-hosted services, and hands-on experiments with open source technologies."
favicon: "/favicon-32x32.png"
excludedFromSitemap: ["/tags/", "/categories/", "/search/"]
sidebar:
avatar:

View File

@ -2,14 +2,16 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
{{ range .Pages }}
<url>
<loc>{{ .Permalink }}</loc>
{{ if not .Lastmod.IsZero }}
<lastmod>{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</lastmod>
{{ end }}
{{ with .Sitemap.ChangeFreq }}
<changefreq>{{ . }}</changefreq>
{{ end }}
</url>
{{ if not (in .Site.Params.excludedFromSitemap .Data.Plural) }}
<url>
<loc>{{ .Permalink }}</loc>
{{ if not .Lastmod.IsZero }}
<lastmod>{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</lastmod>
{{ end }}
{{ with .Sitemap.ChangeFreq }}
<changefreq>{{ . }}</changefreq>
{{ end }}
</url>
{{ end }}
{{ end }}
</urlset>