mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 16:31:52 +01:00
Add `defaultSocialImage` as the default image for social media sharing. This feature would be useful for users who don’t want to specify an image for every article. This PR also resolves the issue where the homepage missing an image when shared.
This commit is contained in:
@@ -107,6 +107,14 @@
|
||||
{{/* Social */}}
|
||||
{{ template "_internal/opengraph.html" . }}
|
||||
{{ template "_internal/twitter_cards.html" . }}
|
||||
{{- /* Image for both main page and backoff if not `*feature*` image found */ -}}
|
||||
{{- /* See https://gohugo.io/templates/embedded/#open-graph */ -}}
|
||||
{{ if not ($.Resources.GetMatch "*feature*") }}
|
||||
{{ with .Site.Params.defaultSocialImage }}
|
||||
<meta name="twitter:image" content="{{ . | absURL }}" />
|
||||
<meta property="og:image" content="{{ . | absURL }}" />
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{/* Schema */}}
|
||||
{{ partial "schema.html" . }}
|
||||
{{/* Me */}}
|
||||
|
||||
Reference in New Issue
Block a user