hugoWebsite/layouts/partials/meta.html
ElastiCourse 8ef17f28fe
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
2023-07-24 19:22:58 -04:00

16 lines
1.2 KiB
HTML

<title itemprop="name">{{if .IsHome}} {{ $.Site.Params.description }} | {{ .Title }}
{{else}} {{ .Title }} | {{ .Site.Title }} {{end}}
</title>
<meta name="description" content="{{ if .Description }}{{ .Description }}{{ else }}{{ .Site.Params.description }}{{ end }}" />
<meta property="og:title" content="{{ .Title }} | {{ .Site.Title }}" />
<meta name="twitter:title" content="{{ .Title }} | {{ .Site.Title }}" />
<meta itemprop="name" content="{{ .Title }} | {{ .Site.Title }}" />
<meta name="application-name" content="{{ .Title }} | {{ .Site.Title }}" />
<meta property="og:description"
content="{{ if .Description }}{{ .Description }}{{ else }}{{ .Site.Params.description }}{{ end }}" />
<meta property="og:site_name" content="{{ .Site.Title }}" />
<meta property="og:url" content="{{ .Permalink }}" />
<meta property="og:locale" content="en">
<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="{{ if .Params.featured_image }}{{ .Params.featured_image | absURL }}{{ else }}{{ .Site.Params.og_image | absURL }}{{ end }}" />
<meta property="og:type" content="{{if .IsHome}}website{{else}}article{{end}}" />