Jafner.net/sites/Jafner.dev/layouts/partials/extra-head.html

36 lines
1.4 KiB
HTML
Raw Permalink Normal View History

{{- with or site.Title site.Params.title | plainify }}
<meta property="og:site_name" content="{{ . }}">
{{- end }}
{{- with or .Title site.Title site.Params.title | plainify }}
<meta property="og:title" content="{{ . }}">
{{- end }}
{{- with or .Description .Summary site.Params.description | plainify | htmlUnescape | chomp }}
<meta property="og:description" content="{{ . }}">
{{- end }}
{{- if .IsPage }}
<meta property="og:type" content="article">
{{- with .Section }}
<meta property="article:section" content="{{ . }}">
{{- end }}
{{- $ISO8601 := "2006-01-02T15:04:05-07:00" }}
{{- with .PublishDate }}
<meta property="article:published_time" {{ .Format $ISO8601 | printf "content=%q" | safeHTMLAttr }}>
{{- end }}
{{- with .Lastmod }}
<meta property="article:modified_time" {{ .Format $ISO8601 | printf "content=%q" | safeHTMLAttr }}>
{{- end }}
{{- range .GetTerms "tags" | first 6 }}
<meta property="article:tag" content="{{ .Page.Title | plainify }}">
{{- end }}
{{- else }}
<meta property="og:type" content="website">
{{- end }}
<meta property="og:url" content="{{ .Permalink }}">
<meta property="article:author" content="Joey Hafner">
<meta property="og:image" content="{{ if .Page.Params.ogimage }}{{ .Permalink }}{{ .Page.Params.ogimage }}{{ else }}{{ .Site.BaseURL }}img/Jafner.dev.logo.png{{ end }}">
<meta name="og:site_name" content="Jafner.dev"/>