From 9686bf9ce438794d2bd1002bedd89e75ca63cb67 Mon Sep 17 00:00:00 2001 From: amzrk2 Date: Sun, 27 Dec 2020 13:12:06 +0800 Subject: fix: og image absolute link --- layouts/partials/head.html | 4 ++-- layouts/partials/opengraph.html | 45 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 layouts/partials/opengraph.html (limited to 'layouts/partials') diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 993e1a9..f4ebe64 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -26,8 +26,8 @@ {{ if .Params.tags }} {{ end }} -{{ template "_internal/opengraph.html" . }} -{{ template "_internal/twitter_cards.html" . }} + +{{ partial "opengraph.html" . }} {{ partial "styles.html" . }} {{ $options := (dict "targetPath" "assets/css/fuji.min.css" "outputStyle" "compressed") }} diff --git a/layouts/partials/opengraph.html b/layouts/partials/opengraph.html new file mode 100644 index 0000000..1437837 --- /dev/null +++ b/layouts/partials/opengraph.html @@ -0,0 +1,45 @@ + + + + + +{{- if .Description -}} + + +{{- else if .Params.description -}} + + +{{- else -}} +{{- if .IsPage -}} + + +{{- end -}} +{{- end -}} + +{{- if .Params.image -}} + + + +{{- else if .Site.Params.og -}} + + + +{{- else -}} + +{{- end -}} + +{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} +{{- if .IsPage -}} +{{- if not .PublishDate.IsZero -}} + +{{- else if not .Date.IsZero -}} + +{{- end -}} +{{- if not .Lastmod.IsZero -}} + +{{- end -}} +{{- else -}} +{{- if not .Date.IsZero -}} + +{{- end -}} +{{- end -}} -- cgit v1.2.3