+ {{ partial "opengraph.html" . }} {{ if .Params.showFullContent }} {{ .Content }} {{ else if .Description }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index a20653b..5996247 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,5 +1,6 @@ {{ define "main" }}
+ {{ partial "opengraph.html" . }}
@@ -17,5 +18,4 @@
- {{ partial "posts_pagination.html" . }} {{ end }} diff --git a/layouts/partials/opengraph.html b/layouts/partials/opengraph.html new file mode 100644 index 0000000..59e63d6 --- /dev/null +++ b/layouts/partials/opengraph.html @@ -0,0 +1,74 @@ + + +{{- with or site.Title site.Params.title | plainify }} + +{{- end }} + +{{- with or .Title site.Title site.Params.title | plainify }} + +{{- end }} + +{{- with or .Description .Summary site.Params.description | plainify | htmlUnescape | chomp }} + +{{- end }} + +{{- with or .Params.locale site.Language.LanguageCode }} + +{{- end }} + +{{- if .IsPage }} + + {{- with .Section }} + + {{- end }} + {{- $ISO8601 := "2006-01-02T15:04:05-07:00" }} + {{- with .PublishDate }} + + {{- end }} + {{- with .Lastmod }} + + {{- end }} + {{- range .GetTerms "tags" | first 6 }} + + {{- end }} +{{- else }} + +{{- end }} + +{{- with partial "_funcs/get-page-images" . }} + {{- range . | first 6 }} + + {{- end }} +{{- end }} + +{{- with .Params.audio }} + {{- range . | first 6 }} + + {{- end }} +{{- end }} + +{{- with .Params.videos }} + {{- range . | first 6 }} + + {{- end }} +{{- end }} + +{{- range .GetTerms "series" }} + {{- range .Pages | first 7 }} + {{- if ne $ . }} + + {{- end }} + {{- end }} +{{- end }} + +{{- with site.Params.social }} + {{- if reflect.IsMap . }} + {{- with .facebook_app_id }} + + {{- else }} + {{- with .facebook_admin }} + + {{- end }} + {{- end }} + {{- end }} +{{- end }}