Skip to content
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_url fails to find images when cachebust=true #2142

Closed
videah opened this issue Mar 16, 2023 · 1 comment
Closed

get_url fails to find images when cachebust=true #2142

videah opened this issue Mar 16, 2023 · 1 comment

Comments

@videah
Copy link

videah commented Mar 16, 2023

Bug Report

Environment

Zola version: zola 0.17.1

Expected Behavior

get_url should return a cachebusting URL to an image as it did in 0.16

Current Behavior

Builds will fail saying get_url can't find or open the image file. This seems to only apply to image files, text files like .js will work just fine. This has only started happening as of 0.17 and was not an issue with 0.16.

Step to reproduce

  1. Run zola init and use default config
  2. Put two images called test1.png and test2.png along with a text file called test.js in static
  3. Create an index.html in templates with the following content:
<!-- This finds this text file no problem, even with cachebust on -->
<script src="{{ get_url(path='test.js', cachebust=true) }}"></script>

<!-- This will find test1.png successfully -->
<img src="{{ get_url(path='test1.png') }}"/>

<!-- This will fail to find test2.png  -->
<img src="{{ get_url(path='test2.png', cachebust=true) }}"/>
  1. Run zola build
zola build
Building site...
Checking all internal links with anchors.
> Successfully checked 0 internal link(s) with anchors.
-> Creating 0 pages (0 orphan) and 0 sections
Error: Failed to build the site
Error: Failed to render section '/Users/videah/Git/zola-bug/content/_index.md'
Error: Reason: Failed to render 'index.html'
Error: Reason: Function call 'get_url' failed
Error: Reason: `get_url`: Could not find or open file test2.png
Keats added a commit that referenced this issue Mar 16, 2023
@Keats
Copy link
Collaborator

Keats commented Mar 16, 2023

It should be fixed in the next branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants