import "github.com/jor-go/sitemap"
type Sitemap struct { Format string `xml:",innerxml"` XMLName xml.Name `xml:"urlset"` XMLNS string `xml:"xmlns,attr"` URLS []URL `xml:"url"` }
Sitemap Holds all the urls in the sitemap
AddURL Adds a single URL to the sitemap
AddURLs Adds multiple URLs to the Sitemap
Generate Creates sitemap []byte
GenerateAndSave Generates and saves to filepath e.g. "/path/to/your/sitemap.xml"
type URL struct { Loc string `xml:"loc"` LastMod string `xml:"lastmod"` ChangeFreq string `xml:"changefreq"` Priority string `xml:"priority"` }
URL is a url for the sitemap
func (u *URL) New(location, changeFrequency string, priority float64, lastModified time.Time) error
New Creates a new URL for the sitemap.
location: URL e.g. https://...
changeFrequency: "always", "hourly", "daily", "weekly", "monthly", "yearly", or "never"
priority: float between 0.0 and 1.0
lastModified: time.Time of the last time link was modified
TimeToLastMod Convert a time.Time to the last modified date as a string
Path | Synopsis |
---|---|
example |
Package sitemap imports 6 packages (graph) and is imported by 1 packages. Updated 2019-05-14. Refresh now. Tools for package owners.