sitemaps is a Go library for generating sitemap.xml files
The sitemaps package can be added to a Go project with go get.
go get cattlecloud.net/go/sitemaps@latestsitemap := make(sitemaps.Site, 0, 1)
sitemap = append(sitemap, &sitemaps.URL{
Location: "/",
Modified: sitemaps.DayFrom(time.Now()),
Frequency: sitemaps.Weekly,
Priority: sitemaps.Low,
})
// w is io.Writer (e.g. http.ResponseWriter)
_ = sitemap.Write(w)The cattlecloud.net/go/sitemaps module is open source under the BSD-3-Clause license.