From 2e04a8ce26a4388a0151613faa62e5746e0218e3 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Thu, 19 Jan 2017 16:02:54 +0200 Subject: [PATCH] Import opengraph partial from Hugo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hugo's current handling of dates in the opengraph partial needs nome work to be more correct—for example: the usage of published and updated times. This comes verbatim from the Hugo source tree. See: tpl/template_embedded.go --- layouts/partials/head-meta.html | 2 +- layouts/partials/opengraph.html | 39 +++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 layouts/partials/opengraph.html diff --git a/layouts/partials/head-meta.html b/layouts/partials/head-meta.html index 61a23c1..7c81769 100644 --- a/layouts/partials/head-meta.html +++ b/layouts/partials/head-meta.html @@ -1,7 +1,7 @@ -{{ template "_internal/opengraph.html" . }} +{{ partial "opengraph.html" . }} {{ template "_internal/twitter_cards.html" . }} {{- with .Site.Params.google_verify_meta -}} diff --git a/layouts/partials/opengraph.html b/layouts/partials/opengraph.html new file mode 100644 index 0000000..e5e6431 --- /dev/null +++ b/layouts/partials/opengraph.html @@ -0,0 +1,39 @@ + + + + +{{ with .Params.images }}{{ range first 6 . }} + +{{ end }}{{ end }} + +{{ if not .Date.IsZero }}{{ end }}{{ with .Params.audio }} +{{ end }}{{ with .Params.locale }} +{{ end }}{{ with .Site.Params.title }} +{{ end }}{{ with .Params.videos }} +{{ range .Params.videos }} + +{{ end }}{{ end }} + + +{{ $permalink := .Permalink }} +{{ $siteSeries := .Site.Taxonomies.series }}{{ with .Params.series }} +{{ range $name := . }} + {{ $series := index $siteSeries $name }} + {{ range $page := first 6 $series.Pages }} + {{ if ne $page.Permalink $permalink }}{{ end }} + {{ end }} +{{ end }}{{ end }} + +{{ if .IsPage }} +{{ range .Site.Authors }}{{ with .Social.facebook }} +{{ end }}{{ with .Site.Social.facebook }} +{{ end }} + + + +{{ with .Params.tags }}{{ range first 6 . }} + {{ end }}{{ end }} +{{ end }}{{ end }} + + +{{ with .Site.Social.facebook_admin }}{{ end }}