-
Notifications
You must be signed in to change notification settings - Fork 1k
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
get_image_metadata: Cannot find path #1161
Comments
I am experiencing exactly the same bug.
Workaround:{% set path = page.path|trim_start_matches(pat="/") %} |
@muhuk Oh, thanks for providing the workaround! |
Something to consider while doing #977 as well |
I just realised, are you using colocated assets? If so you have a |
Hey @Keats, {% if page.extra.social.thumbnail %}
{% set path = page.path|trim_start_matches(pat="/") %}
{% set image_meta = get_image_metadata(path=path ~ page.extra.social.thumbnail) %}
<meta property="og:image" content="{{ get_url(path=page.path) ~ "/" ~ page.extra.social.thumbnail | safe }}">
<meta property="og:image:width" content="{{ image_meta.width }}">
<meta property="og:image:height" content="{{ image_meta.height }}">
{% endif %} And I use this in my page's header:
Just wanted to provide context. |
With the next version, I think something like
will work |
Should be fixed in 0.14. |
I bit late, but I can confirm this is fixed. |
Sharing my work-around a few years too late.
Didn't see this documented anywhere so leaving it behind for future visitors. |
Bug Report
Environment
Zola version: 0.12.0
Expected Behavior
I have a shortcode which uses
get_image_metadata
builtin function on image that is on the same path as the post:0.11.0 was working fine, but...
Current Behavior
...Zola 0.12.0 contains breaking change:
All paths like current_path, page.path, section.path (except colocated assets) now have a leading /
. With this change, I can not build my site, which results in:Steps to reproduce
get_image_metadata
on image inpage.path
location:I can't think of any workaround to resolve the issue, which will strip off forward slash in the beginning.
The text was updated successfully, but these errors were encountered: