Skip to content
This repository was archived by the owner on Jul 21, 2019. It is now read-only.

Commit 63260aa

Browse files
authored
Add social graph headers (#188)
Could still use twitter cards, but this is fine for now. Fixes #128 Signed-off-by: Matt Stratton <matt.stratton@gmail.com>
1 parent a0ecb7a commit 63260aa

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

exampleSite/config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ PaginatePath = "blog"
1212
buildDrafts = false
1313
# Language support
1414
defaultContentLanguage = "en"
15+
weburl = "https://dev.devopsdays.org"
1516

1617
[languages.en]
1718
weight = 0

layouts/partials/head/seo/open_graph.html

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22
<meta property="og:title" content="{{ title .Title }}" />
33
<meta property="og:description" content="{{ if .Description }}{{ .Description }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ end }}{{ end }}" />
44
<meta property="og:type" content="{{ if .Params.type }}{{ .Params.type }}{{ else }}website{{ end }}" />
5-
<meta property="og:url" content="{{ .Permalink }}" />
6-
{{- with .Params.images -}}{{- range first 1 . -}}
7-
<meta property="og:image" content="{{ . }}" />
8-
{{- end -}}{{- end -}}
5+
<meta property="og:url" content="{{ $.Site.Params.weburl }}{{ .Permalink }}" />
6+
{{ if .IsHome }}
7+
<meta property="og:image" content="{{ $.Site.Params.weburl }}/img/event-logo-default.png" />
8+
{{ else }}
9+
{{- with .Params.images -}}{{- range first 1 . -}}
10+
<meta property="og:image" content="{{ $.Site.Params.weburl }}/{{ . }}" />
11+
{{- end -}}{{- end -}}
12+
{{- end -}}
913

1014
<!-- Optional Open Graph Markup -->
1115
<meta property="og:updated_time" content="{{ .Date }}"/>
@@ -30,6 +34,3 @@
3034
{{- with .Params.tags -}}{{- range first 6 . -}}
3135
<meta property="article:tag" content="{{ . }}" />
3236
{{- end -}}{{- end -}}
33-
34-
<!-- Facebook Page Admin ID for Domain Insights -->
35-
{{- with .Site.Params.social.facebook_admin -}}<meta property="fb:admins" content="{{ . }}" />{{- end -}}

0 commit comments

Comments
 (0)