{"id":13396780,"url":"https://github.com/kataras/sitemap","last_synced_at":"2025-03-22T04:30:26.186Z","repository":{"id":65927145,"uuid":"225977598","full_name":"kataras/sitemap","owner":"kataras","description":":new: Sitemap Protocol for Go | https://support.google.com/webmasters/answer/189077?hl=en","archived":false,"fork":false,"pushed_at":"2022-12-24T06:22:43.000Z","size":23,"stargazers_count":20,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T07:51:46.145Z","etag":null,"topics":["go","golang","protocol","sitemap","web-development"],"latest_commit_sha":null,"homepage":"https://www.sitemaps.org/protocol.html","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kataras.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"kataras"}},"created_at":"2019-12-04T23:44:57.000Z","updated_at":"2024-11-18T04:53:20.000Z","dependencies_parsed_at":"2023-02-16T17:10:13.379Z","dependency_job_id":null,"html_url":"https://github.com/kataras/sitemap","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kataras%2Fsitemap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kataras%2Fsitemap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kataras%2Fsitemap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kataras%2Fsitemap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kataras","download_url":"https://codeload.github.com/kataras/sitemap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244907420,"owners_count":20529850,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","protocol","sitemap","web-development"],"created_at":"2024-07-30T18:01:02.966Z","updated_at":"2025-03-22T04:30:25.668Z","avatar_url":"https://github.com/kataras.png","language":"Go","funding_links":["https://github.com/sponsors/kataras"],"categories":["Library","开源类库","Open source library"],"sub_categories":["文本处理","Word Processing"],"readme":"# Sitemap (Go)\r\n\r\n[![build status](https://img.shields.io/github/actions/workflow/status/kataras/sitemap/ci.yml?style=for-the-badge)](https://github.com/kataras/sitemap/actions) [![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=for-the-badge)](https://goreportcard.com/report/github.com/kataras/sitemap) [![godocs](https://img.shields.io/badge/go-%20docs-488AC7.svg?style=for-the-badge)](https://pkg.go.dev/github.com/kataras/sitemap)\r\n\r\n[Sitemap Protocol](https://www.sitemaps.org/protocol.html) implementation for Go. Automatically handles [Sitemap index files](https://www.sitemaps.org/protocol.html#index) `\"/sitemap.xml\"`.\r\n\r\n## Getting started\r\n\r\nThe only requirement is the [Go Programming Language](https://golang.org/dl).\r\n\r\n```sh\r\n$ go get github.com/kataras/sitemap\r\n```\r\n\r\n```go\r\nimport \"github.com/kataras/sitemap\"\r\n```\r\n\r\n```go\r\nsitemaps := sitemap.New(\"http://localhost:8080\").\r\n    URL(sitemap.URL{Loc: \"/home\"}).\r\n    URL(sitemap.URL{Loc: \"/articles\", LastMod: time.Now(), ChangeFreq: sitemap.Daily, Priority: 1}).\r\n    Build()\r\n```\r\n\r\n```go\r\nimport \"net/http\"\r\n```\r\n\r\n```go\r\nfor _, s := range sitemaps {\r\n    http.Handle(s.Path, s)\r\n}\r\n\r\nhttp.ListenAndServe(\":8080\", nil)\r\n```\r\n\r\nVisit http://localhost:8080/sitemap.xml\r\n\r\n```xml\r\n\u003c?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?\u003e\r\n\u003curlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"\u003e\r\n    \u003curl\u003e\r\n        \u003cloc\u003ehttp://localhost:8080/home\u003c/loc\u003e\r\n    \u003c/url\u003e\r\n    \u003curl\u003e\r\n        \u003cloc\u003ehttp://localhost:8080/articles\u003c/loc\u003e\r\n        \u003clastmod\u003e2019-12-05T08:17:35+02:00\u003c/lastmod\u003e\r\n        \u003cchangefreq\u003edaily\u003c/changefreq\u003e\r\n        \u003cpriority\u003e1\u003c/priority\u003e\r\n    \u003c/url\u003e\r\n\u003c/urlset\u003e\r\n```\r\n\r\nFor a more detailed technical documentation you can head over to our [godocs](https://godoc.org/github.com/kataras/sitemap). And for executable code you can always visit the [_examples](_examples) repository's subdirectory.\r\n\r\n## License\r\n\r\nkataras/sitemap is free and open-source software licensed under the [MIT License](https://tldrlegal.com/license/mit-license).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkataras%2Fsitemap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkataras%2Fsitemap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkataras%2Fsitemap/lists"}