* Abs URL for url og tag

+ Support for video embed's
! Default case is still a fallback to using the image tag
This commit is contained in:
shockrah 2021-09-22 13:46:36 -07:00
parent 113c22de73
commit 8767bece60

View File

@ -9,15 +9,23 @@
<title>{{ $title }}</title> <title>{{ $title }}</title>
<meta property="og:title" content="{{ $title }}"> <meta property="og:title" content="{{ $title }}">
<meta property="og:site_name" content="Shockrah's not-a-blog"> <meta property="og:site_name" content="Shockrah's not-a-blog">
{{ $url := print .RelPermalink }} {{ $url := .RelPermalink | absURL }}
<meta property="og:url" content="https://shockrah.xyz"> <meta property="og:url" content="{{$url}}">
{{ $desc := print .Description }} {{ $desc := print .Description }}
{{ if .IsHome }}{{ $desc = .Params.Description }}{{end}} {{ if .IsHome }}{{ $desc = .Params.Description }}{{end}}
<meta property="og:description" content="{{ $desc }}"> <meta property="og:description" content="{{ $desc }}">
<meta property="og:type" content="website"> <meta property="og:type" content="website">
{{ $ogimage := "/favicon.png" }} {{ $ogvideo := "" }}
{{ if .Params.Image }} {{ if .Params.Video }}
{{ $ogimage = .Params.Image }} {{ $ogvideo = .Params.Video }}
<meta property="og:video" content="{{ $ogvideo }}">
<meta property="og:video:width" content="640">
<meta property="og:video:height" content="480">
{{ else }}
{{ $ogimage := "/favicon.png" }}
{{ if .Params.Image }}
{{ $ogimage = .Params.Image }}
{{ end }}
<meta property="og:image" content="{{ $ogimage }}">
{{ end }} {{ end }}
<meta property="og:image" content="{{ $ogimage }}">
</head> </head>