Add basic OpenGraph support

This commit is contained in:
Aroy-Art 2024-02-12 18:43:38 +01:00
parent 7a13351ea2
commit 2e2daa30df
Signed by: Aroy
GPG key ID: 583642324A1D2070
2 changed files with 8 additions and 0 deletions

View file

@ -13,6 +13,8 @@
<meta name="theme-color" content="{{ site.Params.themeColor }}">
{{ end }}
{{ template "partials/opengraph.html" . }}
{{ "<!-- Plugins -->" | safeHTML }}
{{ range site.Params.plugins.css }}
<link rel="stylesheet" href="{{ .link | absURL }}">

View file

@ -0,0 +1,6 @@
<meta property="og:title" content="{{ .Title }}" />
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" />
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" />
<meta property="og:url" content="{{ .Permalink }}" />
<meta property="og:image" content="{{ with .Params.image }}{{ . | absURL }}{{ else }}{{ with .Site.Params.logo }}{{ . | absURL }}{{ end }}{{ end }}" />