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 returns wrong value #2681

Closed
brianmay opened this issue Oct 29, 2024 · 2 comments
Closed

get_url returns wrong value #2681

brianmay opened this issue Oct 29, 2024 · 2 comments

Comments

@brianmay
Copy link

Bug Report

Environment

Zola version: 0.19.2

Expected Behavior

The example at https://www.getzola.org/documentation/content/image-processing/#creating-picture-galleries has:

<div>
{% for asset in page.assets -%}
  {%- if asset is matching("[.](jpg|png)$") -%}
    {% set image = resize_image(path=asset, width=240, height=180) %}
    <a href="{{ get_url(path=asset) }}" target="_blank">
      <img src="{{ image.url }}" />
    </a>
  {%- endif %}
{%- endfor %}
</div>

But when I try to use it, the get_url(...) gives the wrong URL.

In my test case I expected to see:
http://127.0.0.1:1111/people/frank-may/funeral_page_1.png

But I actually got
http://127.0.0.1:1111/people/Frank_May/funeral_page_1.png

This gives a 404 error.

This is for a reference from content/people/Frank_May/index.md to content/people/Frank_May/funeral_page_1.png.

I suspect the problem is the underscore in the section directory name.

@Keats
Copy link
Collaborator

Keats commented Nov 1, 2024

I believe it's the same issue as #2598

@brianmay
Copy link
Author

brianmay commented Nov 1, 2024

Looks like it. Closing this bug report.

@brianmay brianmay closed this as completed Nov 1, 2024
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