diff options
author | Ryan TG <RyanTG@users.noreply.github.com> | 2020-08-09 06:35:03 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-09 06:35:03 +0300 |
commit | bb34c6a1a021024693477d4a14ef6c15184d2f72 (patch) | |
tree | 325b99a1e5a8a1bb449310d768a66230afa1a090 | |
parent | fcdfb2dc36ecd6602ae0bbd1d24164aebae32b45 (diff) |
add opengraph description tag and image fallback (#180)
* add opengraph description tag and image fallback
* clean up meta description logic
-rw-r--r-- | layouts/partials/head.html | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 48c3d03..d322bca 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -4,7 +4,8 @@ {{ with .Site.Title }}<meta property="og:site_name" content="{{ . }}">{{ end }} {{ with .Title }}<meta property=“og:title” content="{{ . }}">{{ end }} - {{ with .Description }}<meta property="og:description" content="{{ . }}">{{ end }} + <meta property="og:description" content="{{ .Description | default .Site.Params.meta.description }}"> + <meta property="description" content="{{ .Description | default .Site.Params.meta.description }}"> <meta property="og:url" content="{{ .RelPermalink | absURL }}"> <meta property="og:type" content="{{ cond .IsHome "website" "article" }}"> {{ with or (.Params.openGraph) (.Params.images) }} @@ -12,6 +13,8 @@ <meta property="og:image" content="{{ .src | absURL }}"> <meta property="og:image:alt" content="{{ .alt }}"> {{ end }} + {{ else }} + <meta property="og:image" content="{{ .Site.Params.intro.pic.src | absURL }}"> {{ end }} {{ with .Site.Params.Social.twitter}}<meta property="twitter:site" content="{{ . }}">{{ end }} |