diff --git a/routers/web/repo/view.go b/routers/web/repo/view.go index 8a2f84bcb..fec62ba01 100644 --- a/routers/web/repo/view.go +++ b/routers/web/repo/view.go @@ -516,6 +516,7 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st if len(ctx.Repo.TreePath) > 0 { ogImg += "/" + util.PathEscapeSegments(ctx.Repo.TreePath) } + ctx.Data["OgImage"] = ogImg ctx.Data["EscapeStatus"] = status ctx.Data["FileContent"] = fileContent @@ -1022,11 +1023,6 @@ func renderCode(ctx *context.Context) { ctx.HTML(http.StatusOK, tplRepoHome) } -func HighlightCodeToImage() error { - - return nil -} - // RenderUserCards render a page show users according the input template func RenderUserCards(ctx *context.Context, total int, getter func(opts db.ListOptions) ([]*user_model.User, error), tpl base.TplName) { page := ctx.FormInt("page") diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl index d4880a99c..ed4c68e02 100644 --- a/templates/base/head.tmpl +++ b/templates/base/head.tmpl @@ -37,19 +37,25 @@ {{if .Owner.Description}} {{end}} -{{else if .PageIsViewCode }} - +{{else if and .PageIsViewCode .HideRepoInfo }} - - - - + - + {{ if .OgImage }} + + + + + + {{ else if (.Repository.AvatarLink $.Context)}} + + {{else}} + + {{ end }} {{else if .Repository}} {{if .Issue}} @@ -58,7 +64,7 @@ {{end}} {{else}} - + {{if .Repository.Description}}