Question about serverless site

I am coming back with a question. I wonder if it is a bug or not. I buildtmy documentation for serverless purpose, still using this part

        {{ $chapter := site.GetPage (trim . " ") }}
        {{ if $chapter }}
        {{ range sort $chapter.Pages "Weight" }}
            {{- $imagePermalink := "" }}
                    {{if .Params.images}}
                        {{- with partial "_funcs/get-page-images" . }}
                        {{- range . | first 1 }}
                        {{- $imagePermalink = .RelPermalink }}
                        {{- end }}
                    {{- end }}
        <a href="{{ .Permalink }}" class="overview-card"
           style="background-image: url('{{ $imagePermalink }}')">

though in the resulting HTML, I get that:

<a href="./userGuide/tutorialsAndHow-Tos.html" class="overview-card highlight" style="background-image: url('/userGuide/tutorialsAndHow-Tos/images/tutos.jpg')">

It does not load the image unless I remove the first / like so

background-image: url('userGuide/tutorialsAndHow-Tos/images/tutos.jpg')

Do you know where this first slash comes and if it is possible to get rid of it?

The relativeURLs configuration setting has several limitations, and you’ve run into one of them.

https://gohugo.io/content-management/urls/#relative-urls

If enabled, Hugo performs a search and replace after it renders the page. It searches for site-relative URLs (those with a leading slash) associated with action , href , src , srcset , and url attributes. It then transforms the URL to be relative to the current page.

So, the transformation ignores stuff like this: url('/something').

I’ve written about this before. In my view a serverless site is almost never worth the cost of putting it together.