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

Relative links to .md inside notice shortcode is not resolved properly #27

Open
mendhak opened this issue Feb 15, 2024 · 1 comment
Open

Comments

@mendhak
Copy link
Owner

mendhak commented Feb 15, 2024

Describe the bug
A relative link inside a {% notice "info" %} shortcode is not rendered as its final URL.

To Reproduce

{% notice "info" %}
Here is [a link inside this notice](./2021-05-10-wsl2-keepassxc-ssh.md).
{% endnotice %}

Here is the [same link outside](./2021-05-10-wsl2-keepassxc-ssh.md).

Expected behavior
The link outside the notice resolves to the page's final URL. The link inside the notice just links to the .md and is unresolved.

First noticed in the little notice box here: https://code.mendhak.com/keepassxc-sign-git-commit-with-ssh/

I can't figure out why though. The markdown library, with the additional rendering function, is being passed to the notice shortcode.

eleventyConfig.addPairedShortcode("notice", (data, noticeType) => notice(data, noticeType, markdownLibrary));

@mendhak
Copy link
Owner Author

mendhak commented May 25, 2024

Eleventy 3.0 comes with this feature called the inputPathToUrl, and there will be no need for the extra plugins in this theme's eleventy.js. Just linking to my-blog.md should make it /blah/my-blog. And it should work within shortcodes too I think.

One last missing bit is the anchor tag like my-blog.md#sectionname , hopefully if this PR is merged, then Eleventy 3.0 can do that bit too.

11ty/eleventy#3276

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