From 4c70f6a3a6d780c2933585dbfb8fb72a4bc75c12 Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Sun, 1 May 2022 11:08:16 +0200 Subject: Rework opengraph support --- layouts/partials/head.html | 16 ++-------------- layouts/partials/templates/opengraph.html | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 14 deletions(-) create mode 100644 layouts/partials/templates/opengraph.html (limited to 'layouts/partials') diff --git a/layouts/partials/head.html b/layouts/partials/head.html index e7c14bd..5c76d9f 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -25,20 +25,8 @@ {{- if .Params.rights }}{{ end }} - - - - {{/* TODO: Check for reatured image */ -}} - - - - {{- /* TODO: add fb:admins and fb:app_id */ -}} - - - - {{- /* TODO: add ability to render 'article' type */ -}} - - + {{- /* Misc */}} + {{template "partials/templates/opengraph.html" . }} {{ partial "styles.html" . -}} {{ partial "scripts.html" . -}} diff --git a/layouts/partials/templates/opengraph.html b/layouts/partials/templates/opengraph.html new file mode 100644 index 0000000..71e040e --- /dev/null +++ b/layouts/partials/templates/opengraph.html @@ -0,0 +1,28 @@ + + + + + +{{- if .Params.cover.image -}} + {{- if (ne .Params.cover.relative true) }} + + {{- else }} + + {{- end }} + + {{- if .Params.cover.width -}} + + {{- end }} + + {{- if .Params.cover.height -}} + + {{- end }} +{{- else }} + + + +{{- end }} + +{{- /* TODO: add fb:admins and fb:app_id */ -}} + + -- cgit v1.2.3