Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Sitemap ¶
type Sitemap struct { XMLName xml.Name `xml:"urlset"` XMLNS string `xml:"xmlns,attr"` URLS []URL `xml:"url"` }
Sitemap Holds all the urls in the sitemap
func (*Sitemap) GenerateAndSave ¶
GenerateAndSave Generates and saves to filepath e.g. "/path/to/your/sitemap.xml"
type URL ¶
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 (*URL) New ¶
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
func (*URL) TimeToLastMod ¶
TimeToLastMod Convert a time.Time to the last modified date as a string
Click to show internal directories.
Click to hide internal directories.