Updated meta.html to show open graph images.

This commit is contained in:
Jeremy Nusser 2022-10-28 18:31:09 -05:00
parent 1a90c59b0a
commit 32ca2d3ae2
3 changed files with 19 additions and 8 deletions

View File

@ -1,3 +1,5 @@
# TailBliss
Hugo + TailwindCSS 3.2.0 + Alpine.js for Hacktoberfest

View File

@ -8,6 +8,7 @@
<link rel="mask-icon" href="/favicon/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">
{{ partial "meta" . }}
<script>
// On page load or when changing themes, best to add inline in `head` to avoid FOUC
if (localStorage.getItem('color-theme') === 'dark' || (!('color-theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
@ -23,4 +24,3 @@
{{ $styles := $styles | minify | fingerprint | resources.PostProcess }}
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}" />
{{ end }}
{{ partial "meta" . }}

View File

@ -1,9 +1,18 @@
<title itemprop="name">{{if .IsHome}} {{ $.Site.Params.description }} | {{ .Title }}
{{else}} {{ .Title }} | {{ .Site.Title }} {{end}}
</title>
<meta name="description" content="{{ .Params.description }}" />
<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:site_name" content="{{ .Site.Params.sitename }}" />
<meta property="og:type" content="website" />
<meta property="og:title" content="{{ if ne .URL "/" }}{{ .Title }} &middot; {{ end }}{{ .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">
{{ if .Params.og_image }}
<meta property="og:image" content="{{ .Params.og_image | relURL }}" />
<meta property="og:image:secure_url" content="{{ .Params.og_image | absURL }}" />
{{ else }}
<meta property="og:image" content="{{ .Site.Params.og_image | relURL }}" />
<meta property="og:image:secure_url" content="{{ .Site.Params.og_image | absURL }}" />
{{ end }}
<meta property="og:type" content="website" />