photogabble / eleventy-plugin-interlinker

Adds wikilink and wikilink embed support with tracking of backlinks.
https://photogabble.co.uk/projects/eleventyjs-interlink-plugin/
MIT License
17 stars 1 forks source link

Wikilink should be linking to the page’s permalink, rather than the slugified version of the title #43

Closed xplosionmind closed 1 month ago

xplosionmind commented 6 months ago

Let’s suppose we want to create a wikilink leading to a note titled Wikilink test and with front matter:

---
permalink: /wlink-tst/
---

Currently, while creating the wilikink, the default parsing behaviour of [[Wikilink test]] is a link to /wikilink-test/. Instead, the plugin should be detecting that there is a permalink value in the front matter of the linked document, hence generate a link to /wlink-tst/

carbontwelve commented 6 months ago

Hello, thank you for the bug report.

I have added a test in commit b73de929bfc72b827c283f9b97b29fdddf787060 that shows this is fixed in the in progress next version of the plugin. In the next version I refactored the way that wikilinks looked up their pages to match in the folowing order:

  1. if is path link, return filePathStem match state
  2. match file url to link href
  3. match file slug to link slug
  4. match file title to link identifier (name)
  5. match fle based upon alias