Use new character structure

This commit is contained in:
2018-03-27 05:25:25 +02:00
parent a1cfe624ae
commit fd6ab8eb02
9 changed files with 39 additions and 130 deletions

View File

@ -1,7 +1,7 @@
component Character(character *arn.Character)
a.character(href="/character/" + character.ID)
img.character-image.lazy(data-src=character.Image, alt=character.Name, title=character.Name)
img.character-image.lazy(data-src=character.ImageLink("medium"), alt=character.Name, title=character.Name)
component CharacterSmall(character *arn.Character)
a.character(href="/character/" + character.ID)
img.character-image.character-image-small.lazy(data-src=character.Image, alt=character.Name, title=character.Name)
img.character-image.character-image-small.lazy(data-src=character.ImageLink("small"), alt=character.Name, title=character.Name)

View File

@ -49,8 +49,8 @@ func Get(ctx *aero.Context) string {
ctx.Data = &arn.OpenGraph{
Tags: map[string]string{
"og:title": character.Name,
"og:image": "https:" + character.Image,
"og:title": character.Name.Canonical,
"og:image": "https:" + character.ImageLink("large"),
"og:url": "https://" + ctx.App.Config.Domain + character.Link(),
"og:site_name": "notify.moe",
"og:description": description,
@ -61,7 +61,7 @@ func Get(ctx *aero.Context) string {
},
Meta: map[string]string{
"description": description,
"keywords": character.Name + ",anime,character",
"keywords": character.Name.Canonical + ",anime,character",
},
}

View File

@ -3,11 +3,16 @@ component CharacterDetails(character *arn.Character, characterAnime []*arn.Anime
.character-left-column
.character-header
.character-image-container
img.character-image-fullsize(src=character.Image, alt=character.Name)
img.character-image-fullsize(src=character.ImageLink("large"), alt=character.Name.Canonical)
.character-description-container
h1.character-name= character.Name
h1.character-name= character.Name.Canonical
.anime-alternative-title
Japanese("日本語の名前無し")
if character.Name.Japanese != ""
Japanese(character.Name.Japanese)
else
Japanese("日本語の名前無し")
.character-description!= markdown.Render(character.Description)
h3 Anime

View File

@ -29,7 +29,7 @@ func Edit(ctx *aero.Context) string {
}
if quote.Character() != nil {
ctx.Data.(*arn.OpenGraph).Tags["og:image"] = quote.Character().Image
ctx.Data.(*arn.OpenGraph).Tags["og:image"] = quote.Character().ImageLink("large")
}
return ctx.HTML(components.QuoteTabs(quote, user) + editform.Render(quote, "Edit quote", user))

View File

@ -32,8 +32,8 @@ func Get(ctx *aero.Context) string {
character, _ := arn.GetCharacter(quote.CharacterID)
if character != nil {
openGraph.Tags["og:title"] = character.Name + "'s quote"
openGraph.Tags["og:image"] = "https:" + character.Image
openGraph.Tags["og:title"] = character.Name.Canonical + "'s quote"
openGraph.Tags["og:image"] = "https:" + character.ImageLink("large")
}
ctx.Data = openGraph