jpsca / jinjax

Server-Side Components with Jinja
https://jinjax.scaletti.dev/
MIT License
233 stars 14 forks source link

Asset root path does not honor catalog folder root #54

Open utenma opened 1 month ago

utenma commented 1 month ago

The catalog folder set on Django is components-jx

    env.add_extension(jinjax.JinjaX)
    catalog = jinjax.Catalog(jinja_env=env)

    catalog.add_folder("components-jx")
    for dir in loader.searchpath:
        catalog.add_folder(os.path.join(dir, "components-jx"))

according to docs paths are resolved according to the folder root

The filepaths must be relative to the root of your components catalog (e.g.: components/).

however the generated imports are relative to 'components', no matter which root folder is set on jinja_env.py

image

component used, path <app>/<project>/jinja2/components-jx/Store/AddToCart.jinja

image