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

Open
nathonius opened this issue Jul 21, 2024 · 0 comments
Open

Transform plugin incompatible with permalink #236

nathonius opened this issue Jul 21, 2024 · 0 comments

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.

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

1 participant