diff options
author | John Olheiser <42128690+jolheiser@users.noreply.github.com> | 2019-10-23 12:54:13 -0500 |
---|---|---|
committer | zeripath <art27@cantab.net> | 2019-10-23 18:54:13 +0100 |
commit | 3e61a9628c4d8866207b6e9fe620bad7e08d30d4 (patch) | |
tree | 69651527079f1107fbbe425824b6c74520bc9621 /templates | |
parent | dbd9d8dd54fd3b0ff7b02ae7b7da8369654e3725 (diff) | |
download | gitea-3e61a9628c4d8866207b6e9fe620bad7e08d30d4.tar.gz gitea-3e61a9628c4d8866207b6e9fe620bad7e08d30d4.zip |
Improve OGP (#8637)
* Improve OGP
* Ensure Repo is loaded when checking Pull info
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/base/head.tmpl | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl index ae2b6b954d..c0686ca93e 100644 --- a/templates/base/head.tmpl +++ b/templates/base/head.tmpl @@ -131,16 +131,25 @@ <meta property="og:type" content="profile" /> <meta property="og:image" content="{{.Owner.AvatarLink}}" /> <meta property="og:url" content="{{.Owner.HTMLURL}}" /> - <meta property="og:site_name" content="{{AppName}}" /> + {{if .Owner.Description}} + <meta property="og:description" content="{{.Owner.Description}}"> + {{end}} {{else if .Repository}} - <meta property="og:title" content="{{.Repository.Name}}" /> + {{if .Issue}} + <meta property="og:title" content="{{.Issue.Title}}" /> + <meta property="og:url" content="{{.Issue.HTMLURL}}" /> + {{if .Issue.Content}} + <meta property="og:description" content="{{.Issue.Content}}" /> + {{end}} + {{else}} + <meta property="og:title" content="{{.Repository.Name}}" /> + <meta property="og:url" content="{{.Repository.HTMLURL}}" /> + {{if .Repository.Description}} + <meta property="og:description" content="{{.Repository.Description}}" /> + {{end}} + {{end}} <meta property="og:type" content="object" /> <meta property="og:image" content="{{.Repository.Owner.AvatarLink}}" /> - <meta property="og:url" content="{{.Repository.HTMLURL}}" /> - {{if .Repository.Description}} - <meta property="og:description" content="{{.Repository.Description}}" /> - {{end}} - <meta property="og:site_name" content="{{AppName}}" /> {{else}} <meta property="og:title" content="{{AppName}}"> <meta property="og:type" content="website" /> @@ -148,6 +157,7 @@ <meta property="og:url" content="{{AppUrl}}" /> <meta property="og:description" content="{{MetaDescription}}"> {{end}} +<meta property="og:site_name" content="{{AppName}}" /> {{if .IsSigned }} {{ if ne .SignedUser.Theme "gitea" }} <link rel="stylesheet" href="{{StaticUrlPrefix}}/css/theme-{{.SignedUser.Theme}}.css"> |