sitemap

package
v1.18.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: MIT Imports: 5 Imported by: 2

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
	Namespace string `xml:"xmlns,attr"`

	URLs []URL `xml:"url"`
}

SitemapUrl represents a sitemap

func NewSitemap

func NewSitemap() *Sitemap

NewSitemap creates a sitemap

func NewSitemapIndex

func NewSitemapIndex() *Sitemap

NewSitemap creates a sitemap index.

func (*Sitemap) Add

func (s *Sitemap) Add(u URL)

Add adds a URL to the sitemap

func (*Sitemap) WriteTo

func (s *Sitemap) WriteTo(w io.Writer) (int64, error)

Write writes the sitemap to a response

type URL

type URL struct {
	URL     string     `xml:"loc"`
	LastMod *time.Time `xml:"lastmod,omitempty"`
}

Url represents a single sitemap entry

Jump to

Keyboard shortcuts

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