项目作者: turk

项目描述 :
Go XML sitemap and sitemap index generator
高级语言: Go
项目地址: git://github.com/turk/go-sitemap.git
创建时间: 2021-09-12T02:46:13Z
项目社区:https://github.com/turk/go-sitemap

开源协议:

下载


Install

go get github.com/turk/go-sitemap

Example for sitemapindex

  1. func () main(c *gin.Context) {
  2. s := sitemap.NewSitemapIndex(c.Writer, true)
  3. s.Add("https://example.org/sitemaps/1.xml")
  4. s.Add("https://example.org/sitemaps/2.xml")
  5. s.Add("https://example.org/sitemaps/3.xml")
  6. s.Write()
  7. }

Example for sitemap

  1. func () main(c *gin.Context) {
  2. s := sitemap.NewSitemap(c.Writer, true)
  3. s.Add(
  4. "https://example.org/who-is-john-doe",
  5. "2021-09-01 15:04:05",
  6. )
  7. s.Write()
  8. }

Support

Please feel free to ask for new features, create pr or report issue.