westerveltco / wagtail-heroicons Goto Github PK
View Code? Open in Web Editor NEWAdd Heroicons to the Wagtail admin.
License: Other
Add Heroicons to the Wagtail admin.
License: Other
Adding "wagtail_heroicons"
to INSTALLED_APPS
gives the following error (on the latest version of Wagtail, on linux)
File "/home/reijer/.pyenv/versions/clean-test/lib/python3.10/site-packages/wagtail/admin/views/home.py", line 388, in sprite
return HttpResponse(icons())
File "/home/reijer/.pyenv/versions/clean-test/lib/python3.10/site-packages/wagtail/admin/views/home.py", line 368, in icons
all_icons = sorted(
TypeError: '<' not supported between instances of 'PosixPath' and 'str'
pip install wagtail
wagtail start mysite
mysite
, run migrations."wagtail_heroicons"
to INSTALLED_APPS
python manage.py runserver
gives the above error.Changing line 14 of src/wagtail_heroicons/wagtail_hooks.py to read icons.append(str(icon.path))
instead of icons.append(icon.path)
fixes the issue.
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
This will always be a simple package and we could get away with having no separate documentation outside the README, however I always find it comforting when trying out a new package that it has documentation, even if it's a small package.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.