Omit files during build?

Does hugo provide a config setting to skip certain files when building?

For instance, I have some files in /static/ that I don’t want in the generated output when I run hugo build.

Otherwise, I’ll have to run a custom task after the build to remove the files, which is fine, but I thought I’d ask if there is a built-in way first.

Take a look at ignoreFiles parameter for the config.

I just tried that, but the files are not ignored in /static/css/ for example.

I found this issue that is still open.

That would explain this behavior. A fix seems to be merged in the latest developer version. If you’re able to compile the dev version of Hugo yourself you could try it this way.

IgnoreFiles currently only work for /content.