I have since solved the issue by using a custom sitemap template. I’m posting details here, for anyone that may stumble into the same situation.
I initially wanted to avoid creating a custom template for the sitemap, because I was worried I would get something wrong – and I hate to override anything unless absolutely necessary.
Since I currently list my blog posts on the “home” page only, I only needed that page, and actual URLs for two sections (“posts”, “pages”) in the sitemap. (As mentioned in the original posts, the list pages for those are what I wanted to remove from the sitemap).
Here’s the sitemap.xml template I came up with:
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
{{ range where .Data.Pages "Section" "pages" }}
{{ if .IsPage }}
<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 }}
</url>
{{ end }}
{{ end }}
{{ range where .Data.Pages "Section" "blog" }}
{{ if .IsPage }}
<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 }}
</url>
{{ end }}
{{ end }}
{{ with .Site.GetPage "home" }}
<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 }}
</url>
{{ end }}
</urlset>
Essentially, I’m manually looping over the specific posts in the sections I care about, and putting those URLs in the sitemap.
I’d much rather have had the option to exclude certain URLs from the sitemap, but this will do for now!