sitemap

package
v0.11.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SitemapLastModFormat = "2006-01-02"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Sitemap

type Sitemap struct {
	// contains filtered or unexported fields
}

Sitemap builds and serves a sitemap.

func New

func New() *Sitemap

New creates a new sitemap.

func (*Sitemap) Serve

func (sitemap *Sitemap) Serve(router chi.Router)

Serve adds a handler to server the sitemap.

func (*Sitemap) Set

func (sitemap *Sitemap) Set(loc, priority, lastmod string)

Set sets a page in the sitemap.

func (*Sitemap) Update

func (sitemap *Sitemap) Update()

Update updates the sitemap content.

type URL

type URL struct {
	XMLName    xml.Name `xml:"url"`
	Loc        string   `xml:"loc"`
	Lastmod    string   `xml:"lastmod"`
	Changefreq string   `xml:"changefreq,omitempty"`
	Priority   string   `xml:"priority,omitempty"`
}

URL is a single entry inside a URLSet.

type URLSet

type URLSet struct {
	XMLName xml.Name `xml:"urlset"`
	XMLNS   string   `xml:"xmlns,attr"`
	URLs    []URL
}

URLSet is a set of urls for the sitemap.xml.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL