Add open Graph meta data

This commit is contained in:
Hanzei 2018-07-01 10:22:28 +02:00
parent 8549e0c94b
commit 8d7109a35f
No known key found for this signature in database
GPG key ID: 69A2DEFD98937BA0
3 changed files with 12 additions and 0 deletions

View file

@ -3,6 +3,7 @@
<head>
{{ block "head" . }}
{{ partial "head/metadata.html" . }}
{{ partial "head/openGraph.html" . }}
{{ partial "head/favicons.html" . }}
{{ partial "head/css.html" . }}
{{ end }}

View file

@ -2,6 +2,7 @@
<html lang="{{ .Site.LanguageCode }}">
<head>
{{ partial "head/metadata.html" . }}
{{ partial "head/openGraph.html" . }}
{{ partial "head/favicons.html" . }}
{{ partial "head/css.html" . }}
</head>

View file

@ -0,0 +1,10 @@
<meta property="og:title" content="{{ .Title }}{{ if ne .Title .Site.Title }} - {{ .Site.Title }}{{ end }}" />
<meta property="og:type" content="website" />
<meta property="og:description" content="{{ if .Description }}{{ .Description }}{{ else }}{{ .Site.Params.description }}{{ end }}"/>
<meta property="og:url" content="{{ .Permalink }}"/>
<meta property="og:site_name" content="{{ .Site.Title }}"/>
{{ if .Params.image }}
<meta property="og:image" content="{{ .Params.image | absURL }}"/>
{{ else }}
<meta property="og:image" content="{{ .Site.Params.avatar | absURL }}"/>
{{ end }}