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

Add social graph headers #188

Merged
merged 1 commit into from
Feb 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ PaginatePath = "blog"
buildDrafts = false
# Language support
defaultContentLanguage = "en"
weburl = "https://dev.devopsdays.org"

[languages.en]
weight = 0
Expand Down
15 changes: 8 additions & 7 deletions layouts/partials/head/seo/open_graph.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
<meta property="og:title" content="{{ title .Title }}" />
<meta property="og:description" content="{{ if .Description }}{{ .Description }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ end }}{{ end }}" />
<meta property="og:type" content="{{ if .Params.type }}{{ .Params.type }}{{ else }}website{{ end }}" />
<meta property="og:url" content="{{ .Permalink }}" />
{{- with .Params.images -}}{{- range first 1 . -}}
<meta property="og:image" content="{{ . }}" />
{{- end -}}{{- end -}}
<meta property="og:url" content="{{ $.Site.Params.weburl }}{{ .Permalink }}" />
{{ if .IsHome }}
<meta property="og:image" content="{{ $.Site.Params.weburl }}/img/event-logo-default.png" />
{{ else }}
{{- with .Params.images -}}{{- range first 1 . -}}
<meta property="og:image" content="{{ $.Site.Params.weburl }}/{{ . }}" />
{{- end -}}{{- end -}}
{{- end -}}

<!-- Optional Open Graph Markup -->
<meta property="og:updated_time" content="{{ .Date }}"/>
Expand All @@ -30,6 +34,3 @@
{{- with .Params.tags -}}{{- range first 6 . -}}
<meta property="article:tag" content="{{ . }}" />
{{- end -}}{{- end -}}

<!-- Facebook Page Admin ID for Domain Insights -->
{{- with .Site.Params.social.facebook_admin -}}<meta property="fb:admins" content="{{ . }}" />{{- end -}}