Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/pacollins/hugo-future-imperfect-slim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan TG <RyanTG@users.noreply.github.com>2020-08-09 06:35:03 +0300
committerGitHub <noreply@github.com>2020-08-09 06:35:03 +0300
commitbb34c6a1a021024693477d4a14ef6c15184d2f72 (patch)
tree325b99a1e5a8a1bb449310d768a66230afa1a090
parentfcdfb2dc36ecd6602ae0bbd1d24164aebae32b45 (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.html5
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 }}