Improved quote editing

This commit is contained in:
2018-02-25 12:19:27 +01:00
parent c9af3561b8
commit c0f490a959
4 changed files with 13 additions and 11 deletions

View File

@ -19,14 +19,9 @@ func Get(ctx *aero.Context) string {
return ctx.Error(http.StatusNotFound, "Quote not found", err)
}
character, err := arn.GetCharacter(quote.CharacterID)
if err != nil {
return ctx.Error(http.StatusNotFound, "Quote not found", err)
}
openGraph := &arn.OpenGraph{
Tags: map[string]string{
"og:title": quote.Description,
"og:title": "Quote",
"og:description": quote.Description,
"og:url": "https://" + ctx.App.Config.Domain + quote.Link(),
"og:site_name": "notify.moe",
@ -34,6 +29,12 @@ func Get(ctx *aero.Context) string {
},
}
character, _ := arn.GetCharacter(quote.CharacterID)
if character != nil {
openGraph.Tags["og:title"] = character.Name + "'s quote"
}
ctx.Data = openGraph
return ctx.HTML(components.QuotePage(quote, character, user))
}