Hi,
I’ve successfully migrated my blog over to Jekyll 4. Linking between blog posts is super easy, but I’m stuck while trying to link from one page to another, in the same subdirectory.
Example:
electronics/rfid/index.md
electronics/rfid/proxmark3.md
The “electronics” subdirectory is immediately under my Git repo root, so not under _pages or _posts. I have ‘electronics’ in my Front Matter defaults in _config.yml (defaults > scope > path)
I want to create a link to the proxmark3 page from the index page. I searched the forum and found How to link from .md page to other page but those solutions seem to assume that the pages are in the toplevel?
Code example, electronics/rfid/index.md:
Here is my link to [Proxmark3]({% link proxmark3.md %})
This fails because Jekyll cannot find the “proxmark3.md” file even though it is really there
ed@BigMac% bundle exec jekyll build --trace
[ ... ]
Incremental build: disabled. Enable with --incremental
Generating...
Jekyll Feed: Generating feed for posts
Liquid Exception: Could not find document 'proxmark3.md' in tag 'link'. Make sure the document exists and the path is correct. in electronics/rfid/index.md
bundler: failed to load command: jekyll (/usr/local/lib/ruby/gems/3.1.0/bin/jekyll)
/usr/local/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/lib/jekyll/tags/link.rb:32:in `render': Could not find document 'proxmark3.md' in tag 'link'. (ArgumentError)
Make sure the document exists and the path is correct.
The proxmark3.md file renders normally when I remove the link from index.md that causes the build to fail, so the file is there and Jekyll seems to understand it.
I’ve tried all kinds of variations, for example:
Here is my link to [Proxmark3]({% link proxmark3.md %})
Here is my link to [Proxmark3]({{ page.dir }} {% link proxmark3.md %})
For “posts” this all works perfectly, but for “pages” I’m not getting anywhere. I must be doing something wrong, but I cannot seem to figure out what that is.
Any help would be appreciated
Regards,
Ed.