added opengraph metadata to head when relevant

This commit is contained in:
Gabriele Musco 2021-03-10 08:41:49 +01:00
parent 6a4c92c4ec
commit fd0cf72329
No known key found for this signature in database
GPG Key ID: 8539FD3454380B83
1 changed files with 16 additions and 0 deletions

View File

@ -28,4 +28,20 @@
{{ $style := resources.Get "/scss/style.scss" | resources.ExecuteAsTemplate "/scss/style.scss" . | resources.ToCSS (dict "targetPath" "css/styles.css" "outputStyle" "compressed" "enableSourceMap" "true") | resources.Fingerprint "sha512" }}
<link type=text/css rel=stylesheet href={{ $style.Permalink }} integrity="{{ $style.Data.Integrity }}" />
{{- partial "inject/head.html" . -}}
<meta property="og:site_name" content='{{ .Site.Title | default "Ficurinia" }}' />
{{ if .IsPage }}
<meta property="og:title" content="{{ .Title }}" />
<meta property="og:type" content="article" />
<meta property="og:type:article:author" content="{{ .Site.Params.Author }}" />
<meta property="og:type:article:published_time" content='{{ .Date.Format "2006-01-02T15:04:05Z-0700" }}' />
{{ range .Params.tags }}
<meta property="og:type:article:tag" content="{{ . }}" />
{{ end }}
<meta property="og:url" content="{{ .Permalink }}" />
<meta property="og:image" content='{{ if .Params.Image }}{{ .Params.Image | absURL }}{{ else }}{{ .Site.Params.Logo | default "/img/icon.svg" | absURL }}{{ end }}' />
<meta property="og:description" content="{{ .Summary }}" />
{{ else }}
<meta property="og:image" content='{{ .Site.Params.Logo | default "/img/icon.svg" | absURL }}' />
{{ end }}
</head>