Rewrite OpenGraph Header

This commit is contained in:
JakobDev 2025-01-01 20:43:20 +01:00
parent e28bd3c4d6
commit e99bf7f16d
No known key found for this signature in database
GPG key ID: 39DEF62C3ED6DC4C
9 changed files with 49 additions and 59 deletions

View file

@ -2070,6 +2070,9 @@ func ViewIssue(ctx *context.Context) {
ctx.Data["RefEndName"] = git.RefName(issue.Ref).ShortName()
ctx.Data["NewPinAllowed"] = pinAllowed
ctx.Data["PinEnabled"] = setting.Repository.Issue.MaxPinned != 0
ctx.Data["OpenGraphTitle"] = issue.Title
ctx.Data["OpenGraphURL"] = issue.HTMLURL()
ctx.Data["OpenGraphDescription"] = issue.Content
ctx.Data["OpenGraphImageURL"] = issue.SummaryCardURL()
ctx.Data["OpenGraphImageAltText"] = ctx.Tr("repo.issues.summary_card_alt", issue.Title, issue.Repo.FullName())