mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 20:02:09 +00:00
Rewrite OpenGraph Header
This commit is contained in:
parent
e28bd3c4d6
commit
e99bf7f16d
9 changed files with 49 additions and 59 deletions
|
@ -394,6 +394,10 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry) {
|
|||
ctx.Data["FileName"] = blob.Name()
|
||||
ctx.Data["RawFileLink"] = ctx.Repo.RepoLink + "/raw/" + ctx.Repo.BranchNameSubURL() + "/" + util.PathEscapeSegments(ctx.Repo.TreePath)
|
||||
|
||||
ctx.Data["OpenGraphTitle"] = ctx.Data["Title"]
|
||||
ctx.Data["OpenGraphURL"] = fmt.Sprintf("%s%s", setting.AppURL, ctx.Data["Link"])
|
||||
ctx.Data["OpenGraphNoDescription"] = true
|
||||
|
||||
if entry.IsLink() {
|
||||
_, link, err := entry.FollowLinks()
|
||||
// Errors should be allowed, because this shouldn't
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue