mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-04-27 14:16:20 -04:00
47 lines
2.4 KiB
HTML
47 lines
2.4 KiB
HTML
{{- $image := "" }}
|
|
{{- with .Params.image }}
|
|
{{- $image = resources.Get (printf "%s%s%s%s" "content" ($.OutputFormats.Get "html").RelPermalink "images/" .) }}
|
|
{{- else }}
|
|
{{- $image = resources.Get (printf "%s%s" "content" $.Site.Params.defaultimage) }}
|
|
{{- end }}
|
|
|
|
<meta property="og:title" content="{{ .Title }}">
|
|
<meta property="og:site_name" content="{{ .Site.Title }}">
|
|
<meta property="og:type" content="{{ if and .IsPage (eq .Type "notes") }}article{{ else }}website{{ 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 }}">
|
|
|
|
{{- with $image }}
|
|
<meta property="og:image" content="{{ replace .Permalink "/content/" "/" }}">
|
|
<meta property="og:image:width" content="{{ .Width }}">
|
|
<meta property="og:image:height" content="{{ .Height }}">
|
|
<meta property="og:image:alt" content="{{ $.Title }}">
|
|
{{- end }}
|
|
|
|
{{- if and .IsPage (eq .Type "notes") }}
|
|
{{- 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 }}
|
|
|
|
{{ with .Site.Author.facebookid }}<meta property="fb:admins" content="{{ . }}">{{ end }}
|
|
{{ with .Site.Params.facebookappid }}<meta property="fb:app_id" content="{{ . }}">{{ end }}
|
|
|
|
<meta name="twitter:card" content="{{ if .IsPage }}summary_large_image{{ else }}summary{{ end }}">
|
|
<meta name="twitter:domain" content="{{ .Site.Params.domain }}">
|
|
{{- with .Site.Author.twitter }}
|
|
<meta name="twitter:site" content="{{ printf "%s%s" "@" . }}">
|
|
<meta name="twitter:creator" content="{{ printf "%s%s" "@" . }}">
|
|
{{- end }}
|
|
{{ with .Site.Author.twitterid }}<meta name="twitter:creator_id" content="{{ . }}">{{ end }}
|
|
<meta name="twitter:dnt" content="on">
|