Difference in behaviour between zola build and zola serve related to 404 pages

Hi all,

I noticed something that i found non intuitive.

There’s a difference in the behaviour of zola build and zola serve.

When you use zola serve and go to a url that does not exist you are served the page from /templates/404.html or the themes/themename/templates/404.html. These are also generated when using zola build

That’s to be expected.

But if you also have a 404.html in static or themes/themename/static/404.html then zola serve and zola build start showing different results.

zola serve will continue to show the 404 from the templates, while zola build will result in the file from static or themes/themename/static being copied to public.

What’s the desired behaviour?

I think both commands should result in the same 404 being shown/built.

Which should be shown? The 404 from static or templates?

Should the command result in an error or warning if you have both in your project?