At this moment, links to the markdown files in the nested directories are lacking a leading ./ which would tell Next.js that they are relative rather than absolute when they start with a dirname or filename.
What is generating the link references? Who is the "Janitor"? There are many cooks in the kitchen.
The link in the markdown is generated by Foam's workspace thinger for VSCode. It generally (and @kortina's VSCode Markdown Notes maybe used to) scans the markdown for wiki-links, checks if there are files that match that name, and if so, adds a link reference to the foot of the markdown doc.
If the file being linked to is in the same directory as the file linking, the link starts with the file or dir name. In this format, the link reference is interpreted by the markdown parser (remark or some one of its plugins) to mean /at-the-root-of-the-site when it says here-anywhere-in-the-tree. The key seems to be that the relative hrefs are missing a leading dot-slash, e.g. ./path/to/note
So I'll try some stuff.
It turns out I was able to parse the hrefs in the AnchorTag component, and when they are relative but not acting that way, I fix it.
This seems to be working. So time to deploy and test and then import the real notes. And then the design. There is so much todo!