diff --git a/dj_iconify/views.py b/dj_iconify/views.py index 166a0596b59a02032c75eff6da2ab41a7d3759fb..f609de3983f08814adb933a5cb8da25a19bfeef9 100644 --- a/dj_iconify/views.py +++ b/dj_iconify/views.py @@ -68,15 +68,16 @@ class ConfigView(View): def get(self, request: HttpRequest) -> HttpResponse: # Guess the base URL by reverse-mapping the URL for a fake icon set rev = reverse("iconify_json", kwargs={"collection": "prefix", "format_": "js"}) - # Iconify SVG Framework expects placeholders {prefix} and {icons} in API URL - api_pattern = rev[:-9] + "{prefix}.js?icons={icons}" + + # Iconify SVG Framework expects just the base path to the API + api_base = rev[:-10] # Put together configuration as dict and output as JSON config = { - "defaultAPI": api_pattern, + "resources": api_base, } config_json = json.dumps(config) - return HttpResponse(f"var IconifyConfig = {config_json}", content_type="text/javascript") + return HttpResponse("var IconifyProviders = {'': " + config_json + "}", content_type="text/javascript") class CollectionView(BaseJSONView): diff --git a/pyproject.toml b/pyproject.toml index 94889503da3151db8f7b4d9c3b31c43bdffef691..e89ba92c2d81769813869d6245b768fe43e59327 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "django-iconify" -version = "0.1.1" +version = "0.2" description = "Iconify API implementation and tools for Django projects" authors = ["Dominik George <dominik.george@teckids.org>"] license = "Apache-2.0"