I am trying to customize the 404 page with an image.
I put an image in site config file as follows:
[params]
errorimg = "images/error.png"
and in the 404 template, the following code returns an error:
<div class="hero">
{{ $errorimg := .Param "errorimg" }}
{{ with $errorimg }}
{{ $image600 := .Fill "600x300 q60 Center" }}
{{ $image900 := .Fill "450x300 q70 Center" }}
{{ $image1200 := .Fill "600x400 q80 Center" }}
<img
alt="error"
class="lazyload blur-up"
src="{{ $image600.RelPermalink }}"
data-sizes="auto"
data-src="{{ $image1200.RelPermalink }}"
data-srcset="{{ $image600.RelPermalink }} 600w, {{ $image900.RelPermalink }} 900w, {{ $image1200.RelPermalink }} 1200w"
>
{{ end }}
</div>
The return error is as follows:
<.Fill>: can't evaluate field Fill in type string
I guess that the way I fetch the errorimg is not good but I don’t know how to do it. Help highly appreciated to get the right syntax