diff options
| author | Serghei Iakovlev <egrep@protonmail.ch> | 2022-04-23 23:08:06 +0200 |
|---|---|---|
| committer | Serghei Iakovlev <egrep@protonmail.ch> | 2022-04-23 23:08:06 +0200 |
| commit | bd5d696c123625118c3a4497c207a3c11e15e882 (patch) | |
| tree | 6f95ef2e9f5984e92b92757f38da7258f24878d7 | |
| parent | 1536c43e1a24f8e01d80aba9cf8dff49fd3b5026 (diff) | |
| download | gohugo-theme-ed-bd5d696c123625118c3a4497c207a3c11e15e882.tar.gz | |
Add Open Graph metadata
| -rw-r--r-- | layouts/partials/head.html | 14 | ||||
| -rw-r--r-- | static/img/open-graph-logo.png | bin | 0 -> 10976 bytes |
2 files changed, 12 insertions, 2 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 57784e8..aa500a1 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -17,16 +17,26 @@ <meta name="viewport" content="width=device-width,initial-scale=1.0,shrink-to-fit=no"> <!-- Canonical link to help search engines --> - <link rel="canonical" href="{{ $resource_url }}"> + <link rel="canonical" href="{{ .Permalink }}"> <title>{{ $title }}</title> <!-- Dublin Core metadata for Zotero --> <meta property="dc:title" content="{{ $title }}"> <meta property="dc:creator" content="{{ $author }}"> - <meta property="dc:identifier" content="{{ $resource_url }}"> + <meta property="dc:identifier" content="{{ .Permalink }}"> {{ if .Params.editor }}<meta property="dc:contributor" content="{{ .Params.editor }}">{{ end }} {{ if .Params.pub_date }}<meta property="dc:date" content="{{ .Params.pub_date }}">{{ end }} {{ if .Params.rights }}<meta property="dc:rights" content="{{ .Params.rights }}">{{ end }} <meta property="dc:source" content="{{ if .Params.source }}{{ .Params.source }}{{ else }}{{ .Site.Title }}{{ end }}"> + + <!-- Open Graph metadata --> + <meta property="og:title" content="{{ $title }}"> + <meta property="og:url" content="{{ .Permalink }}"> + <meta property="og:image" content="{{ $resource_url }}{{ "img/open-graph-logo.png" }}"> + <meta property="og:image:width" content="200"> + <meta property="og:image:height" content="200"> + {{- /* TODO: add fb:admins and fb:app_id */}} + <!-- meta property="fb:admins" content="" --> + <!-- meta property="fb:app_id" content="" --> </head> diff --git a/static/img/open-graph-logo.png b/static/img/open-graph-logo.png Binary files differnew file mode 100644 index 0000000..368939a --- /dev/null +++ b/static/img/open-graph-logo.png |
