Iris 为站点地图协议提供了广泛的支持, 该协议也自动生成 [站点地图](https://www.sitemaps.org/protocol.html#index) "/sitemap.xml" 。
要在 Web 应用程序上启用站点地图,你应该使用 `iris.WithSitemap` 配置。此功能接受公开应用程序的完整方案和域。
```
app := iris.New()
// [...]
app.Run(iris.Addr(":8080"), iris.WithSitemap("http://localhost:8080"))
```
此应用将循环遍历已注册的*静态*路由,并将每个路由添加到站点地图文件中。 默认情况下,仅填充 `<loc>` XML 元素,除非路由的字段 `LastMod`, `ChangeFreq` 或者/和 `Priority`[*](https://www.sitemaps.org/protocol.html) 都已经设置。
```
app.Get("/home", handler).SetLastMod(time.Now()).SetChangeFreq("hourly").SetPriority(0.8)
```
> 一个通过GET HTTP 方法公开的静态路由和他不包括动态参数的路径。 例如 /home, /about 但不是 /user/{id:uint64} 和 e.t.c。
实际操作中查看它,下载并运行以下**示例** : <https://github.com/kataras/iris/tree/master/_examples/sitemap>
如果应用程序**本地化的** ,则 `iris.WithSitemap` 将要添加 `xhtml:link` XML 元素到站点地图文件,在: <https://support.google.com/webmasters/answer/189077?hl=en> 中得到对于每种翻译语言的建议。阅读 [本地化](https://github.com/kataras/iris/wiki/Localization) 部分中了解有关此内容的更多信息。