Added more sitemaps

This commit is contained in:
Eduard Urbach 2017-11-18 16:11:54 +01:00
parent 567aff76f9
commit 063cd16643

View File

@ -90,6 +90,42 @@ func configureAssets(app *aero.Application) {
return ctx.Text(sitemap.Text())
})
// SoundTrack sitemap
app.Get("/sitemap/soundtrack.txt", func(ctx *aero.Context) string {
sitemap := sitemap.New()
prefix := "https://" + app.Config.Domain
for soundTrack := range arn.StreamSoundTracks() {
sitemap.Add(prefix + soundTrack.Link())
}
return ctx.Text(sitemap.Text())
})
// Thread sitemap
app.Get("/sitemap/thread.txt", func(ctx *aero.Context) string {
sitemap := sitemap.New()
prefix := "https://" + app.Config.Domain
for thread := range arn.StreamThreads() {
sitemap.Add(prefix + thread.Link())
}
return ctx.Text(sitemap.Text())
})
// Post sitemap
app.Get("/sitemap/post.txt", func(ctx *aero.Context) string {
sitemap := sitemap.New()
prefix := "https://" + app.Config.Domain
for post := range arn.StreamPosts() {
sitemap.Add(prefix + post.Link())
}
return ctx.Text(sitemap.Text())
})
// For benchmarks
app.Get("/hello", func(ctx *aero.Context) string {
return ctx.Text("Hello World")