Hi,
I’ve a problem using the internal template for og and twitter card.
My feature picture is processed with this code:
{{with .Params.images}}
{{ range .}}
{{ if (fileExists (add `assets/` .)) }}
{{ $image:= resources.Get . }}
{{ $imageLG:= $image.Resize "750x" }}
{{ $imageMD:= $image.Resize "710x" }}
{{ $imageSM:= $image.Resize "540x" }}
{{ $imageXS:= $image.Resize "400x" }}
<picture>
<source srcset="{{ $imageXS.Permalink }}" media="(max-width: 575px)">
<source srcset="{{ $imageSM.Permalink }}" media="(max-width: 767px)">
<source srcset="{{ $imageMD.Permalink }}" media="(max-width: 991px)">
<source srcset="{{ $imageLG.Permalink }}" media="(max-width: 1200px)">
<source srcset="{{ $imageLG.Permalink }}">
<img loading="lazy" class="width-100 margin-45px-bottom" src="{{$imageLG.Permalink}}" alt="{{ $.Page.Description }}">
</picture>
{{ else }}
<img loading="lazy" class="width-100 margin-45px-bottom" src="{{ . | absURL }}" alt="{{ $.Page.Description }}">
{{ end }}
{{ end }}
{{end}}
In the og and twitter url is still the URL from
# post thumb
images:
- "images/post/picture-feature.jpeg"
This picture is not existing after the picture processing which cause a 404 on picture load.
Is there any way to bypass that problem?
Thanks a lot
Mario