1
0
mirror of https://github.com/danbee/danbarber.me.hugo.git synced 2025-03-04 08:59:18 +00:00

Add OG data

This commit is contained in:
Daniel Barber 2019-10-27 13:58:49 -04:00
parent bf7345b9b0
commit 034e8145c9

View File

@ -40,3 +40,19 @@
<link href="https://github.com/danbee" rel="me">
<link href="https://www.instagram.com/danbee/" rel="me">
<link href="/danbarber.gpg" rel="pgpkey">
{{ if .Title }}
<meta property="og:title" content="{{ .Title }} {{ .Site.Title }}">
{{ else }}
<meta property="og:title" content="{{ .Site.Title }}">
{{ end }}
<meta property="og:type" content="article">
<meta property="og:url" content="{{ .Permalink }}">
{{ if .Params.image }}
{{ $imageSize := default "600x600" }}
{{ $src := .Page.Resources.GetMatch (.Params.image) }}
{{ $image := $src.Fit $imageSize }}
<meta property="og:image" content="{{ $image.RelPermalink }}">
{{ end }}
<meta property="og:description" content="{{ .Summary }}">
<meta property="og:locale" content="en_UK">