Follow

Does anyone know how to link an "index.md" file to another one in the same leaf bundle with ?

I have an "index.md" file and I wanna link another file in it. This second file is in the same leaf bundle, at the same level. But I can't get relref to work...

@Apitronics Did you read this topic, and is it of any help for you?

discourse.gohugo.io/t/how-to-r

I don't use (and understand) leaf bundles, so unfortunately I cannot help you.

@im This link only talk about image rendering, right ? 🤔

I'm not sure. All links I can found here are about image rendering...

@Apitronics I think you're right. But I don't know if it matters.

@Apitronics
in the same directory, the link for an "_index.md" is [yourtexttolink](..)

@konkgwin I'm not using "_index.md" file but "index.md". Yhe first one is used in branch bundle, and the second is used in leaf bundle.

Maybe this syntax works with "index.md" too, I will try it.

@konkgwin It seems this syntax didn't work in "index.md" file...

I don't know why, but "[my test](myfile_without_extension)" points to a 404 error, without any error from "hugo server" command.

@Apitronics
Hello, «I don't know why, but "[my test](myfile_without_extension)" points to a 404 error»
Yes, because the link "(myfile_without_extension)" is not the good one. You have to give an adress "unix like" which is, in this case ".." (two dots).
Now your markdown code is "[my test](..)"
hope it works.

@konkgwin The two-dots syntax means "the parent directory" in a unix-like path, right ? 🤔
In my case it's not something like "[my test](./my_file_without_extension)" (because of the file is in the same directory as the index) ?

Thanks to give me some of your time ! 🙂

@konkgwin I tried this solution, but it didn't work. ".." redirect to the previous page, and "." to the current "index.md" file.
So I tried to jump on my file with "./my_file_without_extension" and ""./my_file_with_extension", and both create the same error at access (404 page not found)...

Note that I can reach the index.md file in my subdir, but I can't do the same thing with my buggy file.

Sign in to participate in the conversation
A tech savvy Mastodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!