cover.relative -> cover.absolute

This commit is contained in:
Reorx 2022-05-05 01:39:12 +08:00
parent 2e900af85d
commit c948d475fd
3 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" /> <meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" />
<meta property="og:url" content="{{ .Permalink }}" /> <meta property="og:url" content="{{ .Permalink }}" />
{{- if .Params.cover.image -}} {{- if .Params.cover.image -}}
{{- if (ne .Params.cover.relative true) }} {{- if (eq .Params.cover.absolute true) }}
<meta property="og:image" content="{{ .Params.cover.image | absURL }}" /> <meta property="og:image" content="{{ .Params.cover.image | absURL }}" />
{{- else}} {{- else}}
<meta property="og:image" content="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" /> <meta property="og:image" content="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" />

View File

@ -75,7 +75,7 @@
"inLanguage": {{ .Language.Lang | default "en-us" }}, "inLanguage": {{ .Language.Lang | default "en-us" }},
{{ if .Params.cover.image -}} {{ if .Params.cover.image -}}
"image": "image":
{{- if (ne .Params.cover.relative true) -}} {{- if (eq .Params.cover.absolute true) }}
{{ .Params.cover.image | absURL }}, {{ .Params.cover.image | absURL }},
{{- else -}} {{- else -}}
{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}, {{ (path.Join .RelPermalink .Params.cover.image ) | absURL }},

View File

@ -1,6 +1,6 @@
{{- if .Params.cover.image -}} {{- if .Params.cover.image -}}
<meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:card" content="summary_large_image" />
{{- if (ne $.Params.cover.relative true) }} {{- if (eq .Params.cover.absolute true) }}
<meta name="twitter:image" content="{{ .Params.cover.image | absURL }}" /> <meta name="twitter:image" content="{{ .Params.cover.image | absURL }}" />
{{- else }} {{- else }}
<meta name="twitter:image" content="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" /> <meta name="twitter:image" content="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" />