Skip to content

Relative paths in an folder/index.md file #608

@IllustratedMan-code

Description

@IllustratedMan-code

Describe the bug

In an index.md file in a subfolder, normal links relative to the file do not work as if the index.md is in that subfolder, but rather that the index.md is in the parent dir.

To Reproduce
Steps to reproduce the behavior:

  1. Create an index.md in a subfolder
  2. Add a relative link in that subfolder
  3. See the broken link
  4. Adjust the relative link as if index.md is in the parent folder
  5. See the working link

See my fork of the emanote template for an example

Expected behavior
Relative links should work as if the index.md is where it is.

Comments
This is somewhat addressed in the docs:

Instead of foo.md, you can also use foo/index.md (or index.org if using Org Mode ✍️) or foo/index.yaml. Internally, Emanote will treat them as foo.md and foo.yaml respectively.

I would argue that this is a bit confusing though. I'm happy to make a pull request with a more detailed explanation, but how hard would it be to make index.md use the correct relative path? This way editor integration would be better (i.e. path suggestions).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions