From 063cd166432f9915ff984fe0c7b0c70038b359f2 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Sat, 18 Nov 2017 16:11:54 +0100 Subject: [PATCH] Added more sitemaps --- assets.go | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/assets.go b/assets.go index ef4656a0..026f0076 100644 --- a/assets.go +++ b/assets.go @@ -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")