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

FR add support for images relative to root (starting with /) #4

Open
hidegh opened this issue Feb 13, 2021 · 0 comments
Open

FR add support for images relative to root (starting with /) #4

hidegh opened this issue Feb 13, 2021 · 0 comments

Comments

@hidegh
Copy link

hidegh commented Feb 13, 2021

The solution uses this plugin, but one of the MD does reference an image from the assets, so relatively from root, via: /assets/img/wrong-way.jpg

This makes the build fail, du to the plugin:

`Error` was thrown:
    Error: [Eleventy-Plugin-Page-Assets] Cannot resolve asset "/assets/img/wrong-way.jpg" in "_site/posts/DDD Series - 2 - The history of DDD/index.html" from template "./src/posts/programming/2021-01-05-ddd-series/02/index.md"!
        at C:\$_Work\11ty-custom\node_modules\eleventy-plugin-page-assets\src\plugin.js:80:21

It also results in the MD file not being translated to HTML.

  1. FR: please add support to use images relative to root (starting with /)
  2. BUG: probably a try/catch around the plugin logic would be desirable, so that at least the HTML content gets properly generated (even with a broken IMG link) - still better than having nothing
  3. NOTE: IMO after the const / let issue (see PR fix variable assignment error #2) using directory mode would be probably the best way to approach extra content along the posts (MD files)

11ty-custom.zip


Additionally: when using permalinks post/{title} and fixing the const / let issue in the plugin and using any img copy over, I end up with a weird structure:
image
image

The entire source is attached to play with (debug)...

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