My problem, for the life of me I cannot work out how to link to a page in the same directory as the post. I’ve searched and none of the solutions I have found work.
This is directory structure: (is this called a leaf bundle?)
├posts/
└── test_post2/
├── index.md -> Link to open linked_file2.md
├── linked_file2.md
└── img/
└── image.png
But every attempt / variation I’ve tried to link to a markdown file has failed and it seems to be a pretty basic thing that all website need to do, so why am I having problems doing this/ understanding this?
If I use {{< ref "linked_file2.md" >}} hugo reports this error :
ERROR [en] REF_NOT_FOUND: Ref “linked-file2.md”
I’ve worked out that standard markdown linking doesn’t work (can anyone explain why not?):
[linked_file2](linked_file2.md)
just reports a 404 error when the link is clicked.
Because linked-file2.md is not a page. It’s just a file. And it can’t be a page because of
It’s not clear what you want here: If linked_file2.md should become a page under posts, you must change your directory structure. If you want to link to the original MD file, you must make sure that it’s copied into the public directory at build time. That happens when you put it in static or assets.
The report I am writing is huge, 15 sub documents, 100+ images. Not surprisingly, I want to keep the files relating to the report together in one place.
The idea of trying to manage the document with files and images in a different location does not appeal and is counter intuitive to the way I used to run wordpress where I could put all content related to the post in the same location as the post and simply refer to it with a link.
So I go back to my original question, which the documentation has not helped answer, how do I link to another markdown document and have it correctly rendered as though it were part of the site?
I’m sorry you find the documentation unhelpful, but I suggest you spend some time reading about the differences between leaf bundles (no descendent pages) and branch bundles.