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

Excluding unused favicons from being published? #211

Closed
l-mb opened this issue Oct 23, 2024 · 5 comments
Closed

Excluding unused favicons from being published? #211

l-mb opened this issue Oct 23, 2024 · 5 comments

Comments

@l-mb
Copy link

l-mb commented Oct 23, 2024

Hi, thanks for the great theme.

I have found out to override my favicon.svg (I saw the other issues on this) via static/favicon.svg and the related config.toml setting. That's fine, and I assume that should be sufficient for all scenarios?

But zola build still includes the unused icons/imagery:

 android-chrome-192x192.png   favicon.ico   m192.png   m512.png   mstile-150x150.png
 android-chrome-512x512.png   favicon-16x16.png   m1024.png     m384.png   m72.png
 apple-touch-icon.png	      favicon-32x32.png   m128.png      m48.png    m96.png

And they're referenced in the manifest/sw.js files.

Is there a way to disable them completely?

Thanks, sorry in advance if I misunderstand something (I did try to read the docs) and some of these are required indeed.

@Jieiku
Copy link
Owner

Jieiku commented Oct 23, 2024

add this to your config.toml:

#ignore files

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

Found the answer on this page: https://www.getzola.org/documentation/getting-started/configuration/

@Jieiku Jieiku closed this as completed Oct 23, 2024
@Jieiku
Copy link
Owner

Jieiku commented Oct 23, 2024

I did not test if this excludes it properly from sw.js

Will test that later this evening, but it did properly exclude them from the public folder after a zola build.

EDIT:
It worked when using abridge directly, but as a theme submodule it did not work, will try to investigate more this evening, no time right now.

@Jieiku
Copy link
Owner

Jieiku commented Oct 24, 2024

I opened a report here: getzola/zola#2677

Short of creating empty files to override the ones in the theme I have no idea if this is possible.

@l-mb
Copy link
Author

l-mb commented Oct 24, 2024

Thank you very much, appreciated!

@Jieiku
Copy link
Owner

Jieiku commented Nov 1, 2024

I have added a new array pwa_IGNORE_FILES to config.toml 05a92f2

You could use this value:

pwa_IGNORE_FILES = ["_headers","sw.min.js","sw.js","android-chrome-192x192.png","android-chrome-512x512.png","apple-touch-icon.png","favicon-16x16.png","favicon-32x32.png","favicon.ico","m48.png","m72.png","m96.png","m128.png","m192.png","m384.png","m512.png","m1024.png","mstile-150x150.png"]

The purpose of pwa_IGNORE_FILES is to exclude files from being added to sw.js

In order to modify the manifest.json just copy the manifest.json file from the theme to your sites main static folder, your copy will override the copy in the theme, so you can modify your copy as necessary and remove whatever icons you wish.

If you create empty files in your sites main static folder, they will override the files in the theme with your empty files.

If you do these things then the files will no longer be listed in the manifest.json or sw.js files and the files that are on your site will simply be empty files.

I have no way to prevent the files from being copied over entirely, so the best you can do is override them with empty files unless Zola adds provisions to ignore files within the theme, but this solution should suffice for now.

@Jieiku Jieiku closed this as completed Nov 1, 2024
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

2 participants