diff --git a/mixins/Quote.pixy b/mixins/Quote.pixy index 4eca694f..3a2851fc 100644 --- a/mixins/Quote.pixy +++ b/mixins/Quote.pixy @@ -9,7 +9,8 @@ component QuoteContent(quote *arn.Quote) blockquote p q= quote.Description - if quote.Character() != nil + + if quote.CharacterID != "" && quote.Character() != nil footer.quote-character span= "by" a.ajax(href=quote.Character().Link())= quote.Character().Name diff --git a/mixins/TabLikeQuote.pixy b/mixins/TabLikeQuote.pixy index 0abd565b..aae32d10 100644 --- a/mixins/TabLikeQuote.pixy +++ b/mixins/TabLikeQuote.pixy @@ -1,5 +1,3 @@ -// This should be made abstract for every Likeable so we avoid repeating ourselves but I'm unsure on -// how to do it component TabLikeQuote(label string, icon string, quote *arn.Quote, user *arn.User) if user == nil .tab.action(aria-label=label, title="Login to like this quote") diff --git a/pages/quote/quote.go b/pages/quote/quote.go index 5e1dcd7a..370eef03 100644 --- a/pages/quote/quote.go +++ b/pages/quote/quote.go @@ -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)) } diff --git a/pages/quote/quote.pixy b/pages/quote/quote.pixy index 913b4a1c..be6bd343 100644 --- a/pages/quote/quote.pixy +++ b/pages/quote/quote.pixy @@ -1,5 +1,6 @@ component QuotePage(quote *arn.Quote, character *arn.Character, user *arn.User) QuoteTabs(quote, user) + .quote-full-page .quote-main-column QuoteMainColumn(quote, user) @@ -7,7 +8,7 @@ component QuotePage(quote *arn.Quote, character *arn.Character, user *arn.User) QuoteSideColumn(quote, user) component QuoteMainColumn(quote *arn.Quote, user *arn.User) - .widget-form + .widget-form.mountable QuoteContent(quote) .footer.mountable @@ -29,8 +30,9 @@ component QuoteSideColumn(quote *arn.Quote, user *arn.User) component QuoteInformation(quote *arn.Quote, user *arn.User) section.quote-section.mountable h3.quote-section-name Information + table.quote-info-table - if quote.Anime() != nil + if quote.AnimeID != "" && quote.Anime() != nil tr.mountable(data-mountable-type="info") td.quote-info-key Anime: td.quote-info-value