Added OpenGraph data for characters

This commit is contained in:
Eduard Urbach 2017-11-21 14:55:55 +01:00
parent 08e91ffbca
commit 9be05b953a

View File

@ -34,5 +34,20 @@ func Get(ctx *aero.Context) string {
return characterAnime[i].StartDate < characterAnime[j].StartDate
})
// Set OpenGraph attributes
ctx.Data = &arn.OpenGraph{
Tags: map[string]string{
"og:title": character.Name,
"og:image": character.Image,
"og:url": "https://" + ctx.App.Config.Domain + character.Link(),
"og:site_name": "notify.moe",
"og:description": character.Description,
},
Meta: map[string]string{
"description": character.Description,
"keywords": character.Name + ",anime,character",
},
}
return ctx.HTML(components.CharacterDetails(character, characterAnime, user))
}