-
Notifications
You must be signed in to change notification settings - Fork 991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it just me, or is the search path unclear when calling shortcodes from markdown? #2225
Comments
As you found out, it searches through that: https://github.com/getzola/zola/blob/master/components/templates/src/global_fns/helpers.rs#L7-L18 and doesn't now from where it's being called. |
I think that example is partially the source of my confusion. I tried to do something like I also don't see the search order listed there? |
Ah yes, you can't do any Tera stuff in the markdown. I'll take PRs to clear up the docs though.
It's kind of an implementation detail. If you think it helps understanding, we can add it to the docs |
Cool, just submitted #2227 |
I spent a frustrating hour or two trying to figure out how the
path
parameter is interpreted in{{ resize_image(path=...) }}
. I was a little surprised it seems different from the markdown itself (which will find co-located assets without issue). I finallystrace
-d it and discovered that it searches, in this order:/
(i.e. the root of the zola project)static/
content/
public/
themes/current-theme/static
The absence of CWD (i.e., the directory containing the
.md
file) is what triggered this odyssey. Is this a peculiarity ofresize_image
, or is this fundamental to zola? Either way the behavior is surprising to me and I didn't see it in the docs. Happy to provide a PR if you'd like.The text was updated successfully, but these errors were encountered: