Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chenmingyong0423/go-sitemap-generator
A sitemap generator in Go.
https://github.com/chenmingyong0423/go-sitemap-generator
Last synced: 2 months ago
JSON representation
A sitemap generator in Go.
- Host: GitHub
- URL: https://github.com/chenmingyong0423/go-sitemap-generator
- Owner: chenmingyong0423
- License: mit
- Created: 2024-05-17T03:35:58.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-05-26T16:23:03.000Z (7 months ago)
- Last Synced: 2024-10-03T23:22:44.728Z (3 months ago)
- Language: Go
- Size: 24.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README-zh_CN.md
- License: LICENSE
Awesome Lists containing this project
README
go-sitemap-generator[![GitHub Repo stars](https://img.shields.io/github/stars/chenmingyong0423/go-sitemap-generator)](https://github.com/chenmingyong0423/go-sitemap-generator/stargazers)
[![GitHub issues](https://img.shields.io/github/issues/chenmingyong0423/go-sitemap-generator)](https://github.com/chenmingyong0423/go-sitemap-generator/issues)
[![GitHub License](https://img.shields.io/github/license/chenmingyong0423/go-sitemap-generator)](https://github.com/chenmingyong0423/go-sitemap-generator/blob/main/LICENSE)
[![GitHub release (with filter)](https://img.shields.io/github/v/release/chenmingyong0423/go-sitemap-generator)](https://github.com/chenmingyong0423/go-sitemap-generator)
[![Go Report Card](https://goreportcard.com/badge/github.com/chenmingyong0423/go-sitemap-generator)](https://goreportcard.com/report/github.com/chenmingyong0423/go-sitemap-generator)
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)`go-sitemap-generator` 是一个用 Go 语言编写的 sitemap 生成器。它可以生成 XML 格式的 sitemap。
[English](./README.md) | 中文简体
## 安装
```bash
go get github.com/chenmingyong0423/go-sitemap-generator
```## 使用
```go
err := sitemap.NewSitemap().
Url(
"https://xxx.cn/posts/1",
WithLastMod("2024-05-17"),
WithChangeFreq("weekly"),
WithPriority(1.0),
).
Url("https://xxx.cn/posts/2").Output("sitemap.xml").
GenerateXml()
```