aboutsummaryrefslogtreecommitdiffstats
path: root/templates/base/head_opengraph.tmpl
blob: fc3958b6b6d55bcc924a1a4e453fa4e5e4ce4867 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{{if .PageIsUserProfile}}
	<meta property="og:title" content="{{.ContextUser.DisplayName}}">
	<meta property="og:type" content="profile">
	<meta property="og:image" content="{{.ContextUser.AvatarLink ctx}}">
	<meta property="og:url" content="{{.ContextUser.HTMLURL}}">
	{{if .ContextUser.Description}}
		<meta property="og:description" content="{{.ContextUser.Description}}">
	{{end}}
{{else if .Repository}}
	{{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 if or .PageIsDiff .IsViewFile}}
		<meta property="og:title" content="{{.Title}}">
		<meta property="og:url" content="{{AppUrl}}{{.Link}}">
		{{if and .PageIsDiff (IsMultilineCommitMessage .Commit.Message)}}
			<meta property="og:description" content="{{RenderCommitBody $.Context .Commit.Message $.RepoLink $.Repository.ComposeMetas}}">
		{{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">
	{{if (.Repository.AvatarLink ctx)}}
		<meta property="og:image" content="{{.Repository.AvatarLink ctx}}">
	{{else}}
		<meta property="og:image" content="{{.Repository.Owner.AvatarLink ctx}}">
	{{end}}
{{else}}
	<meta property="og:title" content="{{AppName}}">
	<meta property="og:type" content="website">
	<meta property="og:image" content="{{AssetUrlPrefix}}/img/logo.png">
	<meta property="og:url" content="{{AppUrl}}">
	<meta property="og:description" content="{{MetaDescription}}">
{{end}}
<meta property="og:site_name" content="{{AppName}}">