Keep Markdown project links useful when folders move
A project folder can look complete while its links depend on files somewhere else on your computer.
You send the folder to a colleague. The notes open, but “Read the brief” points to your private Documents folder. The words arrived; the working connection did not.
For files that travel together, a relative link can describe the route within the project. The app or website still has to support opening that kind of destination.
Start with a small folder
Imagine this project:
workshop/
README.md
notes/
planning.md
reference/
brief.md
From notes/planning.md, the brief is one folder up, then inside reference:
Read the [project brief](../reference/brief.md).
On GitHub, relative links in Markdown files resolve in relation to the current file. Other editors and publishing tools may handle local links differently. Test the destination you actually use.
The folder tree and link above are teaching examples, not files supplied with this article.
Move the group together
If the entire workshop folder moves and its internal layout stays the same, the relationship between the planning note and brief stays the same too.
Move only planning.md to the project root and that relationship changes. Its old ../reference/brief.md path no longer describes the brief’s position.
When reorganizing, check incoming links as well as the links inside the file you moved. Searching for the old filename is a useful first pass, though it will not find every possible reference.
Match the link to the reader’s access
A relative path makes sense for a shared folder or repository. A public article usually needs a public website route. A link into a private workspace requires the reader to have access.
Choose deliberately. Uploading a Markdown file by itself will not automatically include the files it links to. Exporting it may change how those links behave.
Use descriptive labels so the reader knows what to expect before opening a link. “Project brief” is more useful than “here.”
Test a copy away from the original
Copy the whole project to another location and open it using the intended reader’s tool. Follow the important links there.
This is a useful way to catch an accidental dependency on your original folder. It is not a substitute for checking permissions when the destination is a shared online service.
Source
- GitHub: relative links describes GitHub’s path behavior.
Keep exploring
See fix missing Markdown images for the related problem of asset paths.