func BuildXMLSitemap(pages []*domain.Page) ([]byte, error) {
	var buf bytes.Buffer
	buf.WriteString(sitemapTemplateHeader)
	for _, p := range pages {
		if p == nil || p.Url == nil {
			continue
		}
		buf.WriteString(fmt.Sprintf(urlTemplate, p.Url.String(), time.Now().Format("2006-01-02")))
	}
	buf.WriteString(sitemapTemplateFooter)
	return buf.Bytes(), nil
}
BuildXMLSitemap builds a standard XML sitemap from a list of pages on a site
package sitemap
import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/url"
	"time"
	"github.com/mattheath/kraken/domain"
)
const (
	sitemapTemplateHeader = `<?xml version="1.0" encoding="utf-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
`
	sitemapTemplateFooter = `</urlset>`
	urlTemplate = `	<url>
		<loc>%s</loc>
		<lastmod>%s</lastmod>
		<changefreq>daily</changefreq>
		<priority>0.8</priority>
	</url>
`
)
type formattedPage struct {
	Url    string   `json:"url"`
	Links  []string `json:"links"`
	Assets []string `json:"assets"`
}