blob: 8be10280d802fe29be621b19856a4f16135802a5 (
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
{{- /*
// GoToSocial
// Copyright (C) GoToSocial Authors admin@gotosocial.org
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ -}}
{{- /*
OPEN GRAPH META TAGS
To enable fancy previews of links to GtS posts/profiles shared via instant
messaging, or other social media, parse out provided Open Graph meta tags.
*/ -}}
{{- with .ogMeta }}
{{- if .Locale }}
<meta property="og:locale" content="{{- .Locale -}}">
{{- else }}
{{- end }}
<meta property="og:type" content="{{- .Type -}}">
<meta property="og:title" content="{{- demojify .Title | noescape -}}">
<meta property="og:url" content="{{- .URL -}}">
<meta property="og:site_name" content="{{- .SiteName -}}">
<meta property="og:description" content="{{- demojify .Description | noescape -}}">
{{- if .ArticlePublisher }}
<meta property="og:article:publisher" content="{{ .ArticlePublisher }}">
<meta property="og:article:author" content="{{ .ArticleAuthor }}">
<meta property="og:article:modified_time" content="{{ .ArticleModifiedTime }}">
<meta property="og:article:published_time" content="{{ .ArticlePublishedTime }}">
{{- else }}
{{- end }}
{{- if .ProfileUsername }}
<meta property="og:profile:username" content="{{- .ProfileUsername -}}">
{{- else }}
{{- end }}
{{- range $i, $m := .Media }}
<meta property="og:{{- $m.OGType -}}" content="{{- $m.URL -}}">
{{- if or (eq $m.OGType "video") (eq $m.OGType "audio") }}
<meta property="og:{{- $m.OGType -}}:secure_url" content="{{- $m.URL -}}">
{{- else }}
{{- end }}
{{- if $m.MIMEType }}
<meta property="og:{{- $m.OGType -}}:type" content="{{ $m.MIMEType }}">
{{- else }}
{{- end }}
{{- if $m.Width }}
<meta property="og:{{- $m.OGType -}}:width" content="{{ $m.Width }}">
<meta property="og:{{- $m.OGType -}}:height" content="{{ $m.Height }}">
{{- else }}
{{- end }}
{{- if $m.Alt }}
<meta property="og:{{- $m.OGType -}}:alt" content="{{ $m.Alt }}">
{{- else }}
{{- end }}
{{- end }}
{{- if .TwitterSummaryLargeImage }}
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="{{- .TwitterSummaryLargeImage -}}">
{{- if .TwitterImageAlt }}
<meta name="twitter:image:alt" content="{{- .TwitterImageAlt -}}">
{{- else }}
{{- end }}
{{- else }}
<meta name="twitter:card" content="summary">
{{- end }}
{{- end }}
|