From bde44fadf20a1f91a466653f9552ce8bd658e2f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sp=C3=A4ti?= Date: Tue, 7 Feb 2023 09:16:15 +0100 Subject: [PATCH] feat: Adding Twitter and Social image preview including description (#207) --- layouts/partials/head.html | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index a608ba70..5c8d6619 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,6 +1,7 @@ {{ $config := cond (eq $.Site.Language.Lang "en") "config" (printf "config.%s" $.Site.Language.Lang) }} {{ $data := index $.Site.Data $config }} +{{.Site.BaseURL}}icon.png @@ -8,6 +9,23 @@ name="description" content="{{if .IsHome}}{{$data.description | default $.Site.Data.config.description}}{{else}}{{.Summary}}{{end}}" /> + + + + + + + + + + + {{ range $data.links }} + {{ if strings.Contains .link "twitter.com" }} + {{ $twitter_handle := index (split .link "/") (sub (len (split .link "/")) 1) }} + + {{ end }} + {{ end }} + {{ if .Title }}{{ .Title }}{{ else }}{{ $data.page_title | default $.Site.Data.config.page_title }}{{ end }}