package sitemap
import "git.sr.ht/~pingoo/stdx/sitemap"
Index ¶
- type ChangeFreq
- type Sitemap
- func New(minify bool) *Sitemap
- func (sitemap *Sitemap) Add(url URL)
- func (sitemap *Sitemap) String() (ret string, err error)
- func (sitemap *Sitemap) WriteTo(w io.Writer) (err error)
- type URL
Types ¶
type ChangeFreq ¶
type ChangeFreq string
ChangeFreq specifies change frequency of a sitemap entry. It is just a string.
const ( Always ChangeFreq = "always" Hourly ChangeFreq = "hourly" Daily ChangeFreq = "daily" Weekly ChangeFreq = "weekly" Monthly ChangeFreq = "monthly" Yearly ChangeFreq = "yearly" Never ChangeFreq = "never" )
type Sitemap ¶
type Sitemap struct { XMLName xml.Name `xml:"urlset"` Xmlns string `xml:"xmlns,attr"` Urls []URL `xml:"url"` // contains filtered or unexported fields }
func New ¶
New returns a new Sitemap.
func (*Sitemap) Add ¶
Add adds an URL to a Sitemap.
func (*Sitemap) String ¶
func (*Sitemap) WriteTo ¶
WriteTo writes XML encoded sitemap to given io.Writer. Implements io.WriterTo.
type URL ¶
type URL struct { Loc string `xml:"loc"` LastMod *time.Time `xml:"lastmod,omitempty"` ChangeFreq ChangeFreq `xml:"changefreq,omitempty"` Priority float32 `xml:"priority,omitempty"` }
Source Files ¶
sitemap.go
- Version
- v0.0.0-20240218134121-094174641f6e (latest)
- Published
- Feb 18, 2024
- Platform
- linux/amd64
- Imports
- 4 packages
- Last checked
- 4 months ago –
Tools for package owners.