The short answer is yes. The longer answer is… longer.
The ref
and relref
shortcodes call the ref
and relref
template functions which use the same underlying logic as .Page.GetPage
and .Site.GetPage
. Beginning with v0.123.0, these functions and methods search for the logical page path, which is a new thing in v0.123.0. You can read about it here:
https://gohugo.io/methods/page/path/
The logical page path is neither a file path nor a URL. It is a logical identifier derived from the file path.
Just like there’s a file tree based on file paths, there is a logical tree based on logical paths. How is that relevant to this topic? Because, when calling the functions and methods referenced above, Hugo v0.123.0 searches the logical tree, not the file tree.
Consider the following file tree:
content/
└── s1/
├── p1/
│ └── index.md <-- "source"
└── p2.md <-- "destination"
If we are traversing the file tree (v0.122.0) from source to destination, the path would be:
../p2.md
Visualizing the same content as a logical tree:
content/
└── s1/
├── p1 <-- "source"
└── p2 <-- "destination"
If we are traversing the logical tree (v0.123.0) from source to destination, the path would be:
p2
The description above excludes some subtle details related to link portability, but for the most part is correct. I’m going to ask @bep to review this for accuracy and/or any nuances we need to be aware of.