Skip to content
This repository has been archived by the owner on Jan 31, 2023. It is now read-only.

Support Sub-Resources URLs for images #41

Open
gwildu opened this issue Dec 21, 2021 · 2 comments
Open

Support Sub-Resources URLs for images #41

gwildu opened this issue Dec 21, 2021 · 2 comments

Comments

@gwildu
Copy link

gwildu commented Dec 21, 2021

Would be great, if you could put images you'd like to refer to in an article right inside the folder where the file for the article is and then refer to it with a sub-resource URL as described here under "Relative URLs": https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_is_a_URL#examples_of_relative_urls

You already support such Routes for links to other articles, but not for images, so it would also be consistent.

File Structure:

- root
  - main
    - sub
      - index.mdx
      - image.png

image markdown:

![my image](image.png)
@gwildu
Copy link
Author

gwildu commented Dec 21, 2021

Just figured out how that would work.
The issue I had, was, that I was not putting the ending / in the link for that article: sub instead of sub/, which then of course was leading to the wrong base path for the sub-resource URL.
Sorry for the disturbance.

@gwildu gwildu closed this as completed Dec 21, 2021
@gwildu gwildu reopened this Dec 21, 2021
@gwildu
Copy link
Author

gwildu commented Dec 21, 2021

Sorry again, but now I figured out, that the trailing / in the link is by default stripped from the href attribute somewhere, so it would be great, if you could keep those trailing slashes so we could also use sub-resource urls for images or also deliver images the same way as you deliver articles because there it is not an issue when the trailing / is missing...

Link Markdown

[sub](sub/)

resulting HTML

<a href="sub/">sub</a>

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

No branches or pull requests

1 participant