hugo-theme-introduction/layouts/partials/head/openGraph.html
2018-07-06 14:31:16 +02:00

13 lines
645 B
HTML

<meta property="og:title" content="{{ .Title }}{{ if ne .Title .Site.Title }} - {{ .Site.Title }}{{ end }}" />
<meta property="og:type" content="website" />
<meta property="og:description" content="{{ if .Description }}{{ .Description }}{{ else }}{{ .Site.Params.description }}{{ end }}"/>
<meta property="og:url" content="{{ .Permalink }}"/>
<meta property="og:site_name" content="{{ .Site.Title }}"/>
{{ with .Resources.ByType "image" }}
{{ range first 5 (sort . "Params.weight") }}
<meta property="og:image" content="{{ .Permalink }}"/>
{{ end }}
{{ else }}
<meta property="og:image" content="{{ .Site.Params.avatar | absURL }}"/>
{{ end }}