Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 this issue Oct 24, 2024 · 2 comments

Comments

@Jieiku
Copy link
Contributor

Jieiku commented Oct 24, 2024

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:

Jieiku/abridge#211
Jieiku/abridge#174
Jieiku/abridge#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
Copy link
Collaborator

Keats commented Oct 24, 2024

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 Keats/tera2#51 ?

@Jieiku
Copy link
Contributor Author

Jieiku commented Oct 25, 2024

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.

andrew-d added a commit to MakeNorth/makenorth.github.io that referenced this issue Oct 27, 2024
1. Don't copy large math files to the output directory since they're not
   used; we create an empty file to "shadow" the ones in the theme. See
   getzola/zola#2677 for more.
2. Move the .gitignore for public/ to the root since the directory is
   recreated by the 'zola serve' command.

Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@Jieiku @Keats and others