File tree Expand file tree Collapse file tree 1 file changed +29
-2
lines changed Expand file tree Collapse file tree 1 file changed +29
-2
lines changed Original file line number Diff line number Diff line change 44< meta name ="description " content ="{{ $params.description | default .Site.Params.description }} ">
55
66{{- if ne $offline true -}}
7- {{ partial "opengraph.html" . }}
8- {{- template "_internal/twitter_cards.html" . -}}
7+ {{- $og := partial "opengraph.html" . -}}
8+ {{- $image := "" -}}
9+ {{- with or .Params.featuredimage .Params.featuredImage -}}
10+ {{- $original := resources.Get . -}}
11+ {{- with $original }}
12+ {{- $processed := .Resize "800x Lanczos" -}}
13+ {{- $image = $processed.Permalink -}}
14+ {{- end -}}
15+ {{- else -}}
16+ {{- with .Resources.GetMatch "featured-image" -}}
17+ {{- $processed := .Resize "800x Lanczos" -}}
18+ {{- $image = $processed.Permalink -}}
19+ {{- else -}}
20+ {{- range .Params.resources -}}
21+ {{- if eq .name "featured-image" -}}
22+ {{- $original := resources.Get .src -}}
23+ {{- with $original }}
24+ {{- $processed := .Resize "800x Lanczos" -}}
25+ {{- $image = $processed.Permalink -}}
26+ {{- end -}}
27+ {{- end -}}
28+ {{- end -}}
29+ {{- end -}}
30+ {{- end -}}
31+ {{- if $image }}
32+ {{- $og = replaceRE `< meta property ="og:image " content ="[^ "]* "> ` (printf `< meta property ="og:image " content ="%s "> ` $image) $og -}}
33+ {{- end -}}
34+ {{- $og | safeHTML -}}
35+ {{- template "_internal/twitter_cards.html" . -}}
936{{- end -}}
1037
1138< meta name ="application-name " content ="{{ .Site.Params.app.title | default .Site.Title }} ">
You can’t perform that action at this time.
0 commit comments