From 15c9ac2bc9a96bbc024ad475bda4a58c09944d55 Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Sun, 17 Jul 2022 19:17:50 +0200 Subject: Move social options in the same place --- layouts/partials/templates/opengraph.html | 34 ++++++++++++++++++++++----- layouts/partials/templates/twitter_cards.html | 7 +++--- 2 files changed, 31 insertions(+), 10 deletions(-) (limited to 'layouts/partials') diff --git a/layouts/partials/templates/opengraph.html b/layouts/partials/templates/opengraph.html index 627605e..f78f8e8 100644 --- a/layouts/partials/templates/opengraph.html +++ b/layouts/partials/templates/opengraph.html @@ -17,10 +17,32 @@ {{- end -}} -{{- /* Facebook Page Admin ID for Domain Insights */}} -{{- with site.Social.facebook_admin }} - -{{- end }} -{{- with site.Social.facebook_id }} +{{- if .IsPage -}} + {{- if not .PublishDate.IsZero }} + + {{- end -}} + + {{- if not .Lastmod.IsZero }} + + {{- end -}} + + {{- if not .ExpiryDate.IsZero }} + + {{- end -}} + + {{- with .Params.categories -}}{{- range $v := . }} + + {{- end -}}{{- end -}} + + {{- with .Params.tags -}}{{- range $v := . }} + + {{- end -}}{{- end -}} +{{- end -}} + +{{- /* Facebook Page Admin ID for Domain Insights */ -}} +{{- with site.Params.social.facebookId }} -{{- end }} +{{- end -}} +{{- with site.Params.social.facebookAdminIds -}}{{- range . }} + +{{- end }}{{- end }} diff --git a/layouts/partials/templates/twitter_cards.html b/layouts/partials/templates/twitter_cards.html index 40a6c3d..d2ef50a 100644 --- a/layouts/partials/templates/twitter_cards.html +++ b/layouts/partials/templates/twitter_cards.html @@ -3,17 +3,16 @@ {{- /* Twitter username for the website used in the card footer */}} - {{- with site.Social.twitter }} + {{- with site.Params.social.twitter }} {{- end }} - {{- $logo := resources.Get (site.Params.assets.logo | default "/img/open-graph-logo.png" ) -}} - {{- if and .IsPage .Params.featuredImage }} {{- $image := .Resources.GetMatch .Params.featuredImage }} - {{- else }} + {{- else -}} + {{- $logo := resources.Get (site.Params.assets.logo | default "/img/open-graph-logo.png" ) }} {{- end -}} -- cgit v1.2.3