diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index e844873..191fadf 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -6,6 +6,8 @@ {{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }} | {{ .Site.Title }}{{ end }} + {{ partial "opengraph.html" . }} + diff --git a/layouts/partials/opengraph.html b/layouts/partials/opengraph.html new file mode 100644 index 0000000..8b81d43 --- /dev/null +++ b/layouts/partials/opengraph.html @@ -0,0 +1,32 @@ +{{/* Open Graph / Social Media Meta Tags */}} + +{{/* Basic OG tags */}} + + + + + + + +{{/* Article-specific tags */}} +{{ if .IsPage }} + +{{ with .Lastmod }}{{ end }} +{{ end }} + +{{/* Image handling: only render if images defined in frontmatter */}} +{{ with .Params.images }} + {{ range first 1 . }} + {{ $img := . }} + {{ if not (hasPrefix $img "http") }} + {{ $img = printf "%s%s" $.Permalink $img }} + {{ end }} + + + {{ end }} +{{ end }} + +{{/* Twitter Card */}} + + +