Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller is a router.Controller which can be used to generate and register sitemap(%d).xml endpoint(s) based on the registered routes.
func New ¶
func New(domain string) *Controller
New returns a new sitemap router. It accepts the domain name as its only parameter. Use the Route's `SetLastMod`, `SetChangeFreq` and `SetPriority` to modify the sitemap's URL child element properties . Excluded routes: - dynamic - subdomain - offline - ExcludeSitemap method called
The "domain" argument is the prefix for the registered routes that will be included in the sitemap.
If more than 50,000 static routes are registered then sitemaps will be splitted and a sitemap index will be served in /sitemap.xml.
If `Application.I18n.Load/LoadAssets` is called then the sitemap will contain translated links for each static route.
If the result does not complete your needs you can take control and use the github.com/kataras/sitemap package to generate a customized one instead. Usage:
app := iris.New()
[Register other routes first...]
app.Router("/", sitemap.New("https://www.example.com"))
func (*Controller) Routing ¶
func (s *Controller) Routing(r router.Router)
Routing implements the router.Controller interface.
func (*Controller) WithLocalization ¶
func (s *Controller) WithLocalization(handler *i18n.Handler, router *i18n.Router) *Controller
WithLocalization adds localization support for the generated links in the sitemap, specify the i18n handler or router or both.