jekyll-relative-links: Relative links not working in includes

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.

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 1
  • Comments: 22

Most upvoted comments

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!

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.

Still an issue

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.