mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-21 13:21:16 -04:00
change a BUNCH of if's to with's to prepare for theme extraction
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
{{- $imagePath := "content/me_large.jpg" -}}
|
||||
{{- if .Params.image }}{{ $imagePath = (printf "%s%s%s%s" "content" (.OutputFormats.Get "html").RelPermalink "images/" .Params.image ) }}{{ end -}}
|
||||
{{- $imagePath := "" }}
|
||||
{{- with .Params.image }}
|
||||
{{- $imagePath = (printf "%s%s%s%s" "content" ($.OutputFormats.Get "html").RelPermalink "images/" .) }}
|
||||
{{- else }}
|
||||
{{- $imagePath = (printf "%s%s" "content" $.Site.Params.defaultimage) }}
|
||||
{{- end }}
|
||||
{{- $image := resources.Get $imagePath -}}
|
||||
|
||||
<meta property="og:title" content="{{ .Title }}">
|
||||
@@ -8,10 +12,14 @@
|
||||
<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 }}">
|
||||
<meta property="og:image:alt" content="{{ .Title }}">
|
||||
|
||||
{{- 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 .IsPage }}
|
||||
{{- if not .PublishDate.IsZero }}
|
||||
<meta property="article:published_time" content="{{ .PublishDate.Format "2006-01-02T15:04:05-07:00" | safeHTMLAttr }}">
|
||||
@@ -25,11 +33,13 @@
|
||||
{{- 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 }}">
|
||||
{{ with .Site.Author.facebook_id }}<meta property="fb:admins" content="{{ . }}">{{ end }}
|
||||
{{ with .Site.Params.facebook_app_id }}<meta property="fb:app_id" content="{{ . }}">{{ end }}
|
||||
<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 }}">
|
||||
{{- with .Site.Author.twitter }}
|
||||
<meta name="twitter:site" content="{{ printf "%s%s" "@" . }}">
|
||||
<meta name="twitter:creator" content="{{ printf "%s%s" "@" . }}">
|
||||
{{- end }}
|
||||
<meta name="twitter:dnt" content="on">
|
||||
<meta name="twitter:widgets:csp" content="on">
|
||||
|
Reference in New Issue
Block a user