benbalter / jekyll-relative-links

A Jekyll plugin to convert relative links to markdown files to their rendered equivalents
MIT License
142 stars 37 forks source link

Relative links not working in includes #54

Open soundasleep opened 5 years ago

soundasleep commented 5 years ago

Description

Create a brand new Jekyll site with the following content:

Hello, world!
[Target](target.md)
or {% include include.md %}
(anything)
Also try go to the [Target](target.md)

Enable jekyll-relative-links, and build the site.

Expected behavior

Both links to target.md are rendered as <a href="target.html">.

Actual behaviour

Only the link to target.md in the root markdown is rendered as <a href="target.html">.

The link included through the include is rendered as <a href="target.md">, breaking navigation.

Workarounds

None known. Changing the include to relative e.g. [Target](../target.md) doesn't work either.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

soundasleep commented 5 years ago

Still an issue

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

dmalan commented 5 years ago

Just wanted to chime in as well to keep this one alive!

dmalan commented 5 years ago

@benbalter, do you have a high-level sense of how this could be implemented, given Jekyll's architecture? We ran into a similar issue with a pre_render hook for :pages, since the pages' content property only contains pages' Markdown, not included files'. Is there perhaps a way to hook into included files as well?

dmalan commented 5 years ago

Just a quick follow-up thought! For a related feature, we've currently resorted to monkey-patching parse_link in Kramdown::Parser::GFM, which then lets us hook into all Markdown files (both pages and includes), but if there's cleaner, Jekyll-based approach, love to do something more robust. Many thanks!

jricher commented 5 years ago

We're also seeing this as an issue.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

dmalan commented 4 years ago

Just keeping alive!

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

nyakase commented 4 years ago

no.

robmoffat commented 4 years ago

Just came to raise an issue and found that this one already exists, perfectly encapsulating my problem on https://riskfirst.org

Would love to know any fix or workaround, other than moving all the content into the root directory, which at the moment seems like the only thing that might work.

thanks, Rob

Home | Risk-First
thaJeztah commented 4 years ago

@dmalan I'm not very familiar with the Jekyll internals; is this something to be fixed in this plugin, or does it require changes in Jekyll and/or Kramdown ?

edit: not very familiar 😓

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

thaJeztah commented 4 years ago

not sure if a wontfix label should be added 😅

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

thaJeztah commented 4 years ago

still relevant I think

dmalan commented 4 years ago

@dmalan I'm not very familiar with the Jekyll internals; is this something to be fixed in this plugin, or does it require changes in Jekyll and/or Kramdown ?

Sorry for missing this, @thaJeztah! Afraid I don't know Jekyll's internals well enough either to know if it can be fixed within the plugin itself!

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

thaJeztah commented 4 years ago

.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

thaJeztah commented 3 years ago

still an issue