File tree Expand file tree Collapse file tree 2 files changed +6
-25
lines changed
themes/hugoplate/layouts/partials/components Expand file tree Collapse file tree 2 files changed +6
-25
lines changed Original file line number Diff line number Diff line change 1717< meta property ="og:site_name " content ="{{ site.Title }} " />
1818
1919{{- with .Params.image -}}
20- {{- $imageUrl := . -}}
21- {{- if not (hasPrefix . "http") -}}
22- {{- with resources.Get . -}}
23- {{- $resized := .Fill "1200x630 webp q85" -}}
24- {{- $imageUrl = $resized.Permalink -}}
25- {{- else -}}
26- {{- $imageUrl = . | absURL -}}
27- {{- end -}}
28- {{- end -}}
29- < meta property ="og:image " content ="{{ $imageUrl }} " />
20+ < meta property ="og:image " content ="{{ . | absURL }} " />
3021 < meta property ="og:image:width " content ="1200 " />
3122 < meta property ="og:image:height " content ="630 " />
3223{{- end -}}
3728< meta name ="twitter:title " content ="{{ $title }} " />
3829< meta name ="twitter:description " content ="{{ $description }} " />
3930{{- with .Params.image -}}
40- {{- $imageUrl := . -}}
41- {{- if not (hasPrefix . "http") -}}
42- {{- with resources.Get . -}}
43- {{- $resized := .Fill "1200x630 webp q85" -}}
44- {{- $imageUrl = $resized.Permalink -}}
45- {{- else -}}
46- {{- $imageUrl = . | absURL -}}
47- {{- end -}}
48- {{- end -}}
49- < meta name ="twitter:image " content ="{{ $imageUrl }} " />
31+ < meta name ="twitter:image " content ="{{ . | absURL }} " />
5032{{- end -}}
Original file line number Diff line number Diff line change 11< div class ="bg-body dark:bg-darkmode-body ">
22 {{ $image:= .Params.image }}
33 {{ if $image }}
4- {{ $imageUrl := $image }}
4+ {{- $imageUrl := $image | relURL - }}
55 {{- if not (hasPrefix $image "http") -}}
6- {{- with resources.Get $image -}}
7- {{- $resized := .Fill "400x234 webp q85" -}}
6+ {{- $resourcePath := strings.TrimPrefix "/" $image -}}
7+ {{- with resources.Get $resourcePath -}}
8+ {{- $resized := .Fill "400x234 q85" -}}
89 {{- $imageUrl = $resized.RelPermalink -}}
9- {{- else -}}
10- {{- $imageUrl = $image | relURL -}}
1110 {{- end -}}
1211 {{- end -}}
1312 < div
You can’t perform that action at this time.
0 commit comments