mirror of
https://github.com/panr/hugo-theme-terminal.git
synced 2024-11-21 17:15:27 +03:00
Fix cover param for og:image
This commit is contained in:
parent
3a101141d0
commit
8b28b06e72
1 changed files with 8 additions and 4 deletions
|
@ -52,8 +52,12 @@
|
|||
<meta property="og:description" content="{{ if .IsHome }}{{ $.Site.Params.Subtitle }}{{ else if .Description}}{{ .Description | plainify }}{{ else }}{{ .Summary | plainify }}{{ end }}" />
|
||||
<meta property="og:url" content="{{ .Permalink }}" />
|
||||
<meta property="og:site_name" content="{{ $.Site.Title }}" />
|
||||
{{ if and (not .IsHome) (isset .Params "cover") }}
|
||||
<meta property="og:image" content="{{ .Param "cover" | absURL }}">
|
||||
{{ if (isset .Params "cover") }}
|
||||
{{ $pageCover := .Param "cover" }}
|
||||
{{ with (.Resources.GetMatch (.Param "cover")) }}
|
||||
{{ $pageCover = .RelPermalink }}
|
||||
{{ end }}
|
||||
<meta property="og:image" content="{{ $pageCover | absURL }}">
|
||||
{{ else }}
|
||||
{{ if isset $.Site.Params "favicon" }}
|
||||
<meta property="og:image" content="{{ $.Site.Params.favicon | absURL }}">
|
||||
|
@ -61,8 +65,8 @@
|
|||
<meta property="og:image" content="{{ printf "img/favicon/%s.png" $.Site.Params.ThemeColor | absURL }}">
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<meta property="og:image:width" content="2048">
|
||||
<meta property="og:image:height" content="1024">
|
||||
<meta property="og:image:width" content="1200">
|
||||
<meta property="og:image:height" content="627">
|
||||
{{ range .Params.categories }}
|
||||
<meta property="article:section" content="{{ . }}" />
|
||||
{{ end }}
|
||||
|
|
Loading…
Reference in a new issue