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

Transform plugin incompatible with permalink #236

Closed
nathonius opened this issue Jul 21, 2024 · 1 comment
Closed

Transform plugin incompatible with permalink #236

nathonius opened this issue Jul 21, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@nathonius
Copy link

nathonius commented Jul 21, 2024

Repro here: https://github.com/nathonius/11ty-demo/tree/main/4-images

Discord thread about this issue

When a urlPath option is NOT provided to the transform plugin, but the template including the image has a permalink attribute that is a filename, not a directory, the image source is incorrectly uses the full html path as if it was a directory. For example:

/blog/posts/Blog Post.md

---
permalink: blog/posts/blog-post.html
---
![alt text](./images/my-img.png)

results in

<img src="/blog/posts/blog-post.html/BshP-bOYIK-710.jpeg" alt="alt text" width="710" height="618">

I'd expect it to understand that the permalink is the full path to the file in this case, not a directory with an index file. This should result in the following (which correctly links to the file):

<img src="/blog/posts/BshP-bOYIK-710.jpeg" alt="alt text" width="710" height="618">

Either removing the permalink (or using a directory permalink) or using a urlPath in the plugin config bypasses the issue.

@zachleat zachleat added the bug Something isn't working label Jan 3, 2025
@zachleat
Copy link
Member

zachleat commented Jan 3, 2025

Shipping with v6.0.0-beta.1

@zachleat zachleat added this to the Eleventy Image v6.0.0 milestone Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants