mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-04-28 05:10:31 -04:00
43 lines
2.4 KiB
HTML
43 lines
2.4 KiB
HTML
{{- $imagePath := "null" -}}
|
|
|
|
{{- if .Params.image }}
|
|
{{ $imagePath = (printf "%s%s%s%s" "content" (.OutputFormats.Get "html").RelPermalink "images/" .Params.image ) }}
|
|
{{- else }}
|
|
{{ $imagePath = "content/me_large.jpg" }}
|
|
{{- end -}}
|
|
|
|
{{- $imageResource := resources.Get $imagePath }}
|
|
{{- .Scratch.Set "image" $imageResource }}
|
|
{{- $image := .Scratch.Get "image" -}}
|
|
|
|
<meta property="og:title" content="{{ .Title }}">
|
|
<meta property="og:site_name" content="{{ .Site.Title }}">
|
|
<meta property="og:type" content="{{ if .IsHome }}website{{ else }}article{{ end }}">
|
|
<meta property="og:locale" content="en_US">
|
|
<meta property="og:url" content="{{ .Permalink }}">
|
|
<meta property="og:description" content="{{ if .Description }}{{ .Description }}{{ else }}{{ .Site.Params.description }}{{ end }}">
|
|
<meta property="og:image" content="{{ if .Params.image }}{{ (printf "%s%s%s" (.OutputFormats.Get "html").Permalink "images/" .Params.image ) }}{{ else }}{{ "me_large.jpg" | absURL }}{{ end }}">
|
|
<meta property="og:image:width" content="{{ $image.Width }}">
|
|
<meta property="og:image:height" content="{{ $image.Height }}">
|
|
{{- if .IsPage }}
|
|
{{- if not .PublishDate.IsZero }}
|
|
<meta property="article:published_time" content="{{ .PublishDate.Format "2006-01-02T15:04:05-07:00" | safeHTMLAttr }}">
|
|
<meta property="article:modified_time" content="{{ .PublishDate.Format "2006-01-02T15:04:05-07:00" | safeHTMLAttr }}">
|
|
{{- else if not .Date.IsZero }}
|
|
<meta property="article:published_time" content="{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTMLAttr }}">
|
|
<meta property="article:modified_time" content="{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTMLAttr }}">
|
|
{{- end }}
|
|
{{- with .Site.Author.facebook }}
|
|
<meta property="article:author" content="https://www.facebook.com/{{ . }}">{{ end }}
|
|
{{- with .Params.tags }}{{ range . }}
|
|
<meta property="article:tag" content="{{ . }}">{{ end }}{{ end }}
|
|
{{- end }}
|
|
<meta property="fb:admins" content="{{ .Site.Author.facebook_id }}">
|
|
<meta property="fb:app_id" content="{{ .Site.Params.facebook_app_id }}">
|
|
<meta name="twitter:card" content="summary">
|
|
<meta name="twitter:domain" content="{{ .Site.Params.domain }}">
|
|
<meta name="twitter:site" content="{{ printf "%s%s" "@" .Site.Author.twitter }}">
|
|
<meta name="twitter:creator" content="{{ printf "%s%s" "@" .Site.Author.twitter }}">
|
|
<meta name="twitter:dnt" content="on">
|
|
<meta name="twitter:widgets:csp" content="on">
|