multiple fixes explained

1. og:type and og:title are both duplicates
2. switch og:type  based on current location (website) or (article)
3. og:image use featuredimage first if available, if not use ogimage for fallback
This commit is contained in:
ElastiCourse 2023-07-24 19:22:58 -04:00 committed by GitHub
parent dcd02bb3d5
commit 8ef17f28fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 5 deletions

View File

@ -6,13 +6,11 @@
<meta name="twitter:title" content="{{ .Title }} | {{ .Site.Title }}" /> <meta name="twitter:title" content="{{ .Title }} | {{ .Site.Title }}" />
<meta itemprop="name" content="{{ .Title }} | {{ .Site.Title }}" /> <meta itemprop="name" content="{{ .Title }} | {{ .Site.Title }}" />
<meta name="application-name" content="{{ .Title }} | {{ .Site.Title }}" /> <meta name="application-name" content="{{ .Title }} | {{ .Site.Title }}" />
<meta property="og:type" content="website" />
<meta property="og:title" content="{{ .Site.Title }}" />
<meta property="og:description" <meta property="og:description"
content="{{ if .Description }}{{ .Description }}{{ else }}{{ .Site.Params.description }}{{ end }}" /> content="{{ if .Description }}{{ .Description }}{{ else }}{{ .Site.Params.description }}{{ end }}" />
<meta property="og:site_name" content="{{ .Site.Title }}" /> <meta property="og:site_name" content="{{ .Site.Title }}" />
<meta property="og:url" content="{{ .Permalink }}" /> <meta property="og:url" content="{{ .Permalink }}" />
<meta property="og:locale" content="en"> <meta property="og:locale" content="en">
<meta property="og:image" content="{{ .Params.Site.BaseURL }}{{ .Site.Params.og_image | relURL }}" /> <meta property="og:image" content="{{ if .Params.featured_image }}{{ .Params.featured_image | relURL }}{{ else }}{{ .Site.Params.og_image | relURL }}{{ end }}" />
<meta property="og:image:secure_url" content="{{ .Site.Params.og_image | absURL }}" /> <meta property="og:image:secure_url" content="{{ if .Params.featured_image }}{{ .Params.featured_image | absURL }}{{ else }}{{ .Site.Params.og_image | absURL }}{{ end }}" />
<meta property="og:type" content="website" /> <meta property="og:type" content="{{if .IsHome}}website{{else}}article{{end}}" />