Merge pull request #128 from willstocks/master

Only populate og:image with cover if is set
This commit is contained in:
Radek Kozieł 2020-04-04 17:21:37 +02:00 committed by GitHub
commit e70a99243e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,7 +40,15 @@
<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="{{ .Title }}" />
<meta property="og:image" content="{{ if .IsHome }}{{ $.Site.Params.favicon | absURL }}{{else}}{{ .Params.Cover | absURL }}{{ end }}">
{{ if and (ne .IsHome) (isset .Params "cover") }}
<meta property="og:image" content="{{ .Param "cover" | absURL }}">
{{ else }}
{{ if isset $.Site.Params "favicon" }}
<meta property="og:image" content="{{ $.Site.Params.favicon | absURL }}">
{{ else }}
<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">
{{ range .Params.categories }}