package builder import ( "io" "website/internal/config" "github.com/snabb/sitemap" ) type Sitemap struct { config *config.Config Sitemap *sitemap.Sitemap } func NewSitemap(cfg config.Config) *Sitemap { return &Sitemap{ config: &cfg, Sitemap: sitemap.New(), } } func (s *Sitemap) Add(u *sitemap.URL) { u.Loc = s.config.BaseURL.JoinPath(u.Loc).String() s.Sitemap.Add(u) } func (s *Sitemap) WriteTo(w io.Writer) (int64, error) { return s.Sitemap.WriteTo(w) }