diff options
author | Hanzei <hanzei@mailbox.org> | 2018-07-01 11:22:28 +0300 |
---|---|---|
committer | Hanzei <hanzei@mailbox.org> | 2018-07-01 11:22:28 +0300 |
commit | 8d7109a35f5571911857b72fce91dadfd02925ca (patch) | |
tree | 5e8273ddd255c26419cb974e50c20b70a27996bf | |
parent | 8549e0c94bde17374d20e3907cbacf3251a20120 (diff) |
Add open Graph meta data
-rw-r--r-- | layouts/_default/baseof.html | 1 | ||||
-rw-r--r-- | layouts/index.html | 1 | ||||
-rw-r--r-- | layouts/partials/head/openGraph.html | 10 |
3 files changed, 12 insertions, 0 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index c3f6407..857da38 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -3,6 +3,7 @@ <head> {{ block "head" . }} {{ partial "head/metadata.html" . }} + {{ partial "head/openGraph.html" . }} {{ partial "head/favicons.html" . }} {{ partial "head/css.html" . }} {{ end }} diff --git a/layouts/index.html b/layouts/index.html index 6d20825..69da4c6 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -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> diff --git a/layouts/partials/head/openGraph.html b/layouts/partials/head/openGraph.html new file mode 100644 index 0000000..736ba45 --- /dev/null +++ b/layouts/partials/head/openGraph.html @@ -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 }} |