sitemap

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSitemap

func GenerateSitemap(posts []*models.Post, config SitemapConfig) (string, error)

GenerateSitemap generates a sitemap.xml from posts

func GenerateSitemapIndex

func GenerateSitemapIndex(sitemapURLs []string, config SitemapConfig) (string, error)

GenerateSitemapIndex generates a sitemap index for large sites

Types

type SitemapConfig

type SitemapConfig struct {
	SiteURL  string
	BlogPath string
}

SitemapConfig contains configuration for sitemap generation

type URL

type URL struct {
	Loc        string  `xml:"loc"`
	LastMod    string  `xml:"lastmod,omitempty"`
	ChangeFreq string  `xml:"changefreq,omitempty"`
	Priority   float64 `xml:"priority,omitempty"`
}

URL represents a single URL entry in the sitemap

type URLSet

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

URLSet represents the root sitemap element

Jump to

Keyboard shortcuts

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