blog/themes/shockrah.xyz/layouts/partials/head.html
shockrah 8767bece60 * Abs URL for url og tag
+ Support for video embed's
! Default case is still a fallback to using the image tag
2021-09-22 13:46:36 -07:00

32 lines
1.3 KiB
HTML

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="/css/style.css">
<link rel="stylesheet" href="https://unpkg.com/purecss@1.0.0/build/pure-min.css" integrity="sha384-nn4HPE8lTHyVtfCBi5yW9d20FjT8BJwUXyWZT9InLYax14RDjBj46LmSztkmNP9w" crossorigin="anonymous">
<link rel="shortcut icon" type="image/png" href="/favicon.png"/>
{{ $title := print .Title }}
{{ if .IsHome }}{{ $title = .Site.Title}}{{end}}
<title>{{ $title }}</title>
<meta property="og:title" content="{{ $title }}">
<meta property="og:site_name" content="Shockrah's not-a-blog">
{{ $url := .RelPermalink | absURL }}
<meta property="og:url" content="{{$url}}">
{{ $desc := print .Description }}
{{ if .IsHome }}{{ $desc = .Params.Description }}{{end}}
<meta property="og:description" content="{{ $desc }}">
<meta property="og:type" content="website">
{{ $ogvideo := "" }}
{{ if .Params.Video }}
{{ $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 }}
</head>