diff --git a/hugo.yaml b/hugo.yaml index 945a1ed..ee58b16 100644 --- a/hugo.yaml +++ b/hugo.yaml @@ -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: diff --git a/layouts/_default/sitemap.xml b/layouts/_default/sitemap.xml index dd95cb2..2b98530 100644 --- a/layouts/_default/sitemap.xml +++ b/layouts/_default/sitemap.xml @@ -2,14 +2,16 @@ {{ range .Pages }} - - {{ .Permalink }} - {{ if not .Lastmod.IsZero }} - {{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }} - {{ end }} - {{ with .Sitemap.ChangeFreq }} - {{ . }} - {{ end }} - + {{ if not (in .Site.Params.excludedFromSitemap .Data.Plural) }} + + {{ .Permalink }} + {{ if not .Lastmod.IsZero }} + {{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }} + {{ end }} + {{ with .Sitemap.ChangeFreq }} + {{ . }} + {{ end }} + + {{ end }} {{ end }} \ No newline at end of file