Added Open Graph to soundtracks

This commit is contained in:
Eduard Urbach 2017-07-21 16:33:29 +02:00
parent 1cf023e476
commit e9e0aa89eb

View File

@ -17,5 +17,15 @@ func Get(ctx *aero.Context) string {
return ctx.Error(http.StatusNotFound, "Track not found", err) return ctx.Error(http.StatusNotFound, "Track not found", err)
} }
ctx.Data = &arn.OpenGraph{
Tags: map[string]string{
"og:title": track.Media[0].Title,
"og:image": track.Anime()[0].Image.Large,
"og:url": "https://" + ctx.App.Config.Domain + track.Link(),
"og:site_name": "notify.moe",
"og:type": "music.song",
},
}
return ctx.HTML(components.Track(track)) return ctx.HTML(components.Track(track))
} }