Added Open Graph data to anime

This commit is contained in:
2017-07-06 20:33:46 +02:00
parent 4cac9f5544
commit e47f1d298f
3 changed files with 26 additions and 2 deletions

View File

@ -39,5 +39,22 @@ func Get(ctx *aero.Context) string {
}
}
// Open Graph
openGraph := map[string]string{
"og:title": anime.Title.Canonical,
"og:image": anime.Image.Large,
"og:url": "https://" + ctx.App.Config.Domain + anime.Link(),
"og:site_name": "notify.moe",
}
switch anime.Type {
case "tv":
openGraph["og:type"] = "video.tv_show"
case "movie":
openGraph["og:type"] = "video.movie"
}
ctx.Data = openGraph
return ctx.HTML(components.Anime(anime, tracks, user, episodesReversed))
}