Socket
Book a DemoInstallSign in
Socket

github.com/kataras/sitemap

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/kataras/sitemap

v0.0.6
Source
Go
Version published
Created
Source

Sitemap (Go)

build status report card godocs

Sitemap Protocol implementation for Go. Automatically handles Sitemap index files "/sitemap.xml".

Getting started

The only requirement is the Go Programming Language.

$ go get github.com/kataras/sitemap
import "github.com/kataras/sitemap"
sitemaps := sitemap.New("http://localhost:8080").
    URL(sitemap.URL{Loc: "/home"}).
    URL(sitemap.URL{Loc: "/articles", LastMod: time.Now(), ChangeFreq: sitemap.Daily, Priority: 1}).
    Build()
import "net/http"
for _, s := range sitemaps {
    http.Handle(s.Path, s)
}

http.ListenAndServe(":8080", nil)

Visit http://localhost:8080/sitemap.xml

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <url>
        <loc>http://localhost:8080/home</loc>
    </url>
    <url>
        <loc>http://localhost:8080/articles</loc>
        <lastmod>2019-12-05T08:17:35+02:00</lastmod>
        <changefreq>daily</changefreq>
        <priority>1</priority>
    </url>
</urlset>

For a more detailed technical documentation you can head over to our godocs. And for executable code you can always visit the _examples repository's subdirectory.

License

kataras/sitemap is free and open-source software licensed under the MIT License.

FAQs

Package last updated on 19 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.