Added summary to OG data

This commit is contained in:
2017-07-06 20:44:47 +02:00
parent e47f1d298f
commit 0e009f434c

View File

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