Not all static files are copied over

Hello,
when in development server mode, it seems that hugo is not delivering all the static files, which are in my folder.
I come to believe that it’s only serving those files, that are explicitly referenced in html (I could reproduce this).
However I’m referencing some svg files in my css (e.g. with background-image: url(img/logo.svg), and these files are not published by the server.
How can I achieve this?

I’m on the most current version v0.109.0+extended

I am unable to reproduce this, but I am suspicious of:

url(img/logo.svg)

That URL is relative to the style sheet.

If the path to your logo is static/img/logo.jpg and your CSS file is published to public/css/style.css, a relative URL will not work.

You would need to do this instead:

url(/img/logo.svg)
1 Like

@jmooring I can confirm your suspicion. I improved the relative URLs with your suggestion, so e.g. url('/img/logo.svg') and now they are served.

Thank you for your kind help :slight_smile:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.