diff options
author | Alan Pearce | 2024-06-18 20:13:26 +0200 |
---|---|---|
committer | Alan Pearce | 2024-06-18 20:13:26 +0200 |
commit | b27c96688785372787eb5c3c71a32767fab71ac4 (patch) | |
tree | 2e39bc6cd94724953cf917c509fb141d39690cf1 /internal/builder/sitemap.go | |
parent | 1d247493e05cdc659e46cd3d8a01d5da1e893867 (diff) | |
download | website-b27c96688785372787eb5c3c71a32767fab71ac4.tar.lz website-b27c96688785372787eb5c3c71a32767fab71ac4.tar.zst website-b27c96688785372787eb5c3c71a32767fab71ac4.zip |
split content and sitemap code from builder
Diffstat (limited to 'internal/builder/sitemap.go')
-rw-r--r-- | internal/builder/sitemap.go | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/internal/builder/sitemap.go b/internal/builder/sitemap.go deleted file mode 100644 index 81e3a31..0000000 --- a/internal/builder/sitemap.go +++ /dev/null @@ -1,29 +0,0 @@ -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) -} |