Syntax issue with custom 404 page

I am trying to customize the 404 page with an image.
I put an image in site config file as follows:

    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" }}
          class="lazyload blur-up"
          src="{{ $image600.RelPermalink }}"
          data-src="{{ $image1200.RelPermalink }}"
          data-srcset="{{ $image600.RelPermalink }} 600w, {{ $image900.RelPermalink }} 900w, {{ $image1200.RelPermalink }} 1200w"
      {{ end }}

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


Unfortunately, it doesn’t work.
The following code works well but without image processing:

<div class="hero">
        class="lazyload blur-up"
        data-src="{{ .Site.Params.errorimg | absURL }}"

Does it means that I got the image but unable to process as a resource ?

Sorry, I’ve not used Hugo’s image processing. You got the parameter back as text though right? I expect there is a function required to turn it into an image resource.

If I understood your scenario correctly, yes. According to the docs:

The image is a Page Resource, and the processing methods listed below does not work on images inside your /static folder.

I will find another way to deal with it