You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I saw in the default template {{@root.baseurl}} so I tried to use it in a pattern to point to icons that I added to the assets directory. Using it here adds an extra ../. From what I can tell this happens because @root is the initial context that the template was executed in. Is there a way to use this in a pattern that I am just not seeing or do I have to hard code the directory levels?
I'm using it like this: <use xlink:href="{{@root.baseurl}}/assets/toolkit/images/icons.svg#{{icon}}" />
and getting <use xlink:href="../../../assets/toolkit/images/icons.svg#bell" />
when I should get <use xlink:href="../../assets/toolkit/images/icons.svg#bell" />
The text was updated successfully, but these errors were encountered:
Another thing that is very weird about it is that I didn't notice an issue until pushing it to gh-pages. In dev, even though the path is wrong, the icon shows up. Once I run gulp demo and view it there the images don't load (which they shouldn't based on the path).
Same Problem here. Did you ever manage to fix this?
EDIT:
I found out that the "getBaseUrl" function in utils/context.js considers the complete path to html files when creating the relative url. But patterns will be grouped in drizzle and displayed on a single html page. So while the path might be correct for the source files it doesn't consider the rendered files.
I saw in the default template
{{@root.baseurl}}
so I tried to use it in a pattern to point to icons that I added to the assets directory. Using it here adds an extra../
. From what I can tell this happens because@root
is the initial context that the template was executed in. Is there a way to use this in a pattern that I am just not seeing or do I have to hard code the directory levels?I'm using it like this:
<use xlink:href="{{@root.baseurl}}/assets/toolkit/images/icons.svg#{{icon}}" />
and getting
<use xlink:href="../../../assets/toolkit/images/icons.svg#bell" />
when I should get
<use xlink:href="../../assets/toolkit/images/icons.svg#bell" />
The text was updated successfully, but these errors were encountered: