summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorAndrew <write@imaginarycode.com>2017-02-11 07:57:33 -0500
committerLunny Xiao <xiaolunwen@gmail.com>2017-02-11 20:57:33 +0800
commit3f676760599896f168e454d132b368658751974a (patch)
tree8f481aebd091515ed2e922dc40a2bd26f059ae8f /templates
parent8a0be5e9f01caaf3667c420f08541ac7c26127b8 (diff)
downloadgitea-3f676760599896f168e454d132b368658751974a.tar.gz
gitea-3f676760599896f168e454d132b368658751974a.zip
Implement basic Open Graph support. (#901)
Diffstat (limited to 'templates')
-rw-r--r--templates/base/head.tmpl24
1 files changed, 24 insertions, 0 deletions
diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl
index 18805953b4..f4b883335e 100644
--- a/templates/base/head.tmpl
+++ b/templates/base/head.tmpl
@@ -46,6 +46,30 @@
<link rel="stylesheet" href="{{AppSubUrl}}/plugins/dropzone-4.2.0/dropzone.css">
{{end}}
<style class="list-search-style"></style>
+
+ <!-- Open Graph -->
+{{if .PageIsUserProfile}}
+ <meta property="og:title" content="{{.Owner.Name}}" />
+ <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}}" />
+{{else if .Repository}}
+ <meta property="og:title" content="{{.Repository.Name}}" />
+ <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" />
+ <meta property="og:image" content="{{AppSubUrl}}/img/gitea-lg.png" />
+ <meta property="og:url" content="{{AppUrl}}" />
+ <meta property="og:description" content="Gitea (Git with a cup of tea) is a painless self-hosted Git service written in Go">
+{{end}}
</head>
<body>
<div class="full height">