Skip to content

Commit

Permalink
refactor icon installation by simplifying hook
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuadavidthomas committed Mar 23, 2024
1 parent 7bf3c2f commit 26d9fdb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 58 deletions.
41 changes: 0 additions & 41 deletions src/wagtail_heroicons/icons.py

This file was deleted.

13 changes: 5 additions & 8 deletions src/wagtail_heroicons/wagtail_hooks.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
from __future__ import annotations

try:
from wagtail import hooks
except ImportError:
from wagtail.core import hooks
from pathlib import Path

from .icons import Heroicon
from wagtail import hooks


@hooks.register("register_icons")
def register_icons(icons):
for icon in Heroicon.get_icons():
icons.append(str(icon.path))
return icons
template_dir = Path(__file__).parent / "templates" / "heroicons"
heroicons = [file.stem for file in template_dir.glob("*.svg")]
return icons + heroicons
9 changes: 0 additions & 9 deletions tests/test_icons.py

This file was deleted.

0 comments on commit 26d9fdb

Please sign in to comment.