getzola / zola

A fast static site generator in a single binary with everything built-in. https://www.getzola.org
https://www.getzola.org
MIT License
13.72k stars 953 forks source link

ignored_static working only if you run a theme directly, Does Not work if you use the theme as a submodule #2677

Open Jieiku opened 1 week ago

Jieiku commented 1 week ago

Bug Report

ignored_static working only if you run a theme directly, Does Not work if you use the theme as a submodule

Environment

Zola version: 0.19.2

Expected Behavior

I have had a few requests to disable/omit the favicons in my theme:

https://github.com/Jieiku/abridge/issues/211 https://github.com/Jieiku/abridge/issues/174 https://github.com/Jieiku/abridge/issues/106

I thought the ignored_static static feature would work perfectly for this. The only way you can currently use the ignored_static feature is to directly modify and use a theme.

Current Behavior

If you use the theme as a submodule for another site, then the option does not work, and the favicons from the theme are still copied over.

Step to reproduce

You can set the option in the theme directly, and it will work:

ignored_static = ["apple-touch-icon.png","banner.png","safari-pinned-tab.svg","favicon*","m*.png","android-chrome*png"]

Next try using the theme as a submodule for a new site, the static favicon files still get copied over to public after zola build.

Keats commented 6 days ago

Isn't that intended? Only the [extra] data from the theme config gets copied, not the actual Zola config. Unless I misunderstand.

Unrelated but since your theme has some meaty macros: what are you thoughts on https://github.com/Keats/tera2/issues/51 ?

Jieiku commented 6 days ago

I was hoping there was a way for people to exclude files in the static folder of the theme...

If the ignored_static is not meant to do that, then maybe we need an ignored_static_theme option.

Edit: I include a full set of favicons in the abridge theme, and often people only want to create 1 favicon or none at all, but all those favicons from the theme still get copied over, unless they create their own favicon to replace every single one.