jekyll-relative-links icon indicating copy to clipboard operation
jekyll-relative-links copied to clipboard

Relative links not working in includes

Open soundasleep opened this issue 5 years ago • 22 comments

Description

Create a brand new Jekyll site with the following content:

  • index.md
Hello, world!
[Target](target.md)
or {% include include.md %}
  • target.md
(anything)
  • _includes/include.md
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.

soundasleep avatar May 02 '19 23:05 soundasleep

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.

stale[bot] avatar Jul 01 '19 23:07 stale[bot]

Still an issue

soundasleep avatar Jul 02 '19 00:07 soundasleep

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.

stale[bot] avatar Aug 31 '19 17:08 stale[bot]

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

dmalan avatar Sep 01 '19 15:09 dmalan

@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 avatar Sep 16 '19 06:09 dmalan

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!

dmalan avatar Sep 18 '19 00:09 dmalan

We're also seeing this as an issue.

jricher avatar Oct 15 '19 13:10 jricher

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.

stale[bot] avatar Dec 14 '19 16:12 stale[bot]

Just keeping alive!

dmalan avatar Dec 14 '19 16:12 dmalan

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.

stale[bot] avatar Feb 12 '20 17:02 stale[bot]

no.

nyakase avatar Feb 18 '20 16:02 nyakase

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

robmoffat avatar Mar 08 '20 11:03 robmoffat

@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 😓

thaJeztah avatar Apr 10 '20 13:04 thaJeztah

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.

stale[bot] avatar Jun 09 '20 14:06 stale[bot]

not sure if a wontfix label should be added 😅

thaJeztah avatar Jun 09 '20 14:06 thaJeztah

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.

stale[bot] avatar Aug 08 '20 14:08 stale[bot]

still relevant I think

thaJeztah avatar Aug 08 '20 21:08 thaJeztah

@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!

dmalan avatar Aug 08 '20 22:08 dmalan

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.

stale[bot] avatar Oct 11 '20 23:10 stale[bot]

.

thaJeztah avatar Oct 12 '20 00:10 thaJeztah

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.

stale[bot] avatar Dec 25 '20 16:12 stale[bot]

still an issue

thaJeztah avatar Dec 25 '20 19:12 thaJeztah