diff --git a/exampleSite/config.toml b/exampleSite/config.toml index b36d169..0d284a2 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -22,6 +22,11 @@ logo = "" logo_white = "" # when logo is empty, it will shown your site title +# OpenGraph / Twitter Card metadata +description = "This is meta description" +author = "Themefisher" +image = "images/logo.png" # this image will be used as fallback if a page has no image of its own + # customize color primary_color = "#02007e" body_color = "#f9f9f9" diff --git a/layouts/partials/head.html b/layouts/partials/head.html index c7b8ada..e3693d7 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -57,4 +57,33 @@ {{ "" | safeHTML }} {{ end }} + + +{{ $image_path := .Params.image | default site.Params.image }} +{{ $image_path_local := printf "static/%s" $image_path }} +{{ $image_ext := trim (path.Ext $image_path | lower) "." }} +{{ if fileExists $image_path_local }} + + {{ if ne $image_ext "svg" }} + {{ with (imageConfig $image_path_local) }} + {{ if (and (gt .Width 144) (gt .Height 144)) }} + + + {{ end }} + + + {{ end }} + {{ end }} + +{{ end }} + + +{{ with site.Social.twitter }}{{ end }} +{{ range site.Authors }} + {{ with .twitter }}{{ end }} +{{ end }} + +{{ template "_internal/opengraph.html" . }} +{{ template "_internal/twitter_cards.html" . }} +