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

Move to native namespace packages for sifferent icon types #29

Open
joshuadavidthomas opened this issue Nov 10, 2022 · 2 comments
Open

Comments

@joshuadavidthomas
Copy link
Member

Related to #28, in the heroicon package the icons are actually stored in a zip file to save space. This poses a problem for how Wagtail deals with SVG icons, as it expects the SVG to be a template somewhere where a template loader can find it.

As far as I can tell, Django does not come with a way to load templates from a zip. We may need to write a custom one, utilizing heroicons._load_icon or heroicons._render_icon in some way.

https://docs.djangoproject.com/en/4.1/ref/templates/api/#custom-loaders

@joshuadavidthomas
Copy link
Member Author

joshuadavidthomas commented Apr 21, 2023

On second thought, for such a simple package, maybe writing a custom template loader would be overkill to mainly slim down the package.

I wonder if using extra packages would be another way to slim it down to only include the icons a person could want, e.g.:

pip install wagtail-heroicons[outline,solid]  # for Heroicons v1.x
pip install wagtail-heroicons[mini,outline,solid]  # for Heroicons v2.x

@joshuadavidthomas
Copy link
Member Author

Native namespace packages is I think the right way to do this (probably), provided you can install them as extras. I think you can, but testing will need to be done to check.

@joshuadavidthomas joshuadavidthomas changed the title Explore writing a custom Template loader to load from zip file Move to native namespace packages for sifferent icon types Mar 23, 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

1 participant