Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangeFreq ¶
type ChangeFreq string
const ( ALWAYS ChangeFreq = "always" HOURLY ChangeFreq = "hourly" DAILY ChangeFreq = "daily" WEEKLY ChangeFreq = "weekly" MONTHLY ChangeFreq = "monthly" YEARLY ChangeFreq = "yearly" NEVER ChangeFreq = "never" ALTERNATE = "alternate" )
type Sitemap ¶
type Sitemap struct {
XMLName xml.Name `xml:"urlset"`
XMLNS string `xml:"xmlns,attr"`
XMLNSXHTML *string `xml:"xmlns:xhtml,attr,omitempty"`
Urls []Url `xml:",innerxml"`
}
func (*Sitemap) AddAlternateSupport ¶
func (s *Sitemap) AddAlternateSupport()
func (*Sitemap) GetXMLOutput ¶
GetXMLOutput generates the xml for the sitemap
func (*Sitemap) RemoveAlternateSupport ¶
func (s *Sitemap) RemoveAlternateSupport()
func (*Sitemap) WriteToFile ¶
WriteToFile generates the sitemap.xml content and writes it to the specified file
type Url ¶
type Url struct {
XMLName xml.Name `xml:"url"`
Location string `xml:"loc"`
LastMod *XMLTime `xml:"lastmod,omitempty"`
ChangeFreq *ChangeFreq `xml:"changefreq,omitempty"`
Priority *float32 `xml:"priority,omitempty"`
Alternates *[]Alternate `xml:",innerxml"`
}
func (*Url) AddAlternate ¶
func (*Url) SetChangeFreq ¶
func (u *Url) SetChangeFreq(cf ChangeFreq)
SetChangeFreq defines how often url is expected to be updated
func (*Url) SetLastModified ¶
SetLastModified sets the date for when this url was last modified
func (*Url) SetLocation ¶
SetLocation sets the location for the url
func (*Url) SetPriority ¶
SetPriority should get a value between 0.0 and 1.0
Click to show internal directories.
Click to hide internal directories.