feat: Update twitter card

This commit is contained in:
Simon 2022-02-16 12:50:05 +01:00
parent 2f1f498090
commit 8576d3cb9d
1 changed files with 5 additions and 5 deletions

View File

@ -28,7 +28,7 @@
<meta name="twitter:title" content="{{ default .Site.Title .Title }}" />
<meta name="twitter:description" content="{{ $.Site.Params.description }}" />
<meta name="twitter:url" content="{{ .Site.BaseURL }}" />
<meta name="twitter:image:src" content="{{ .Site.BaseURL}}{{ .Site.Params.SocialImage }}" />
<meta name="twitter:image" content="{{ .Site.BaseURL}}{{ .Site.Params.SocialImage }}" />
{{ else }}
<title>{{ .Title }} &middot; {{ .Site.Title }}</title>
<meta name="description" content="{{ .Description }}" />
@ -45,9 +45,9 @@
{{ end }}
<meta name="twitter:url" content="{{ .Permalink }}" />
{{ if .Params.SocialImage }}
<meta name="twitter:image:src" content="{{ .Site.BaseURL }}{{ .Params.SocialImage }}" />
<meta name="twitter:image" content="{{ .Site.BaseURL }}{{ .Params.SocialImage }}" />
{{ else }}
<meta name="twitter:image:src" content="{{ .Site.Params.SocialImage }}" />
<meta name="twitter:image" content="{{ .Site.BaseURL }}{{ .Site.Params.SocialImage }}" />
{{ end }}
{{ end }}
{{ if .Params.tags }}
@ -63,7 +63,7 @@
"@context": "http://schema.org/",
"@type": "WebSite",
"name": "{{ default .site.Title .Title }}",
"image": "{{ .Site.Params.SocialImage }}",
"about": "{{ $.Site.Params.description }}"
"image": "{{ .Site.BaseURL}}{{ default .Site.Params.SocialImage .Params.SocialImage }}",
"about": "{{ .Site.Params.description }}"
}
</script>