What prevents relref and ref from not working with this taxonomy?

I did arrive at a solution before I posted this, but I’m not sure how I got there.

I have a whole bunch of tags set up like this:

  • content/tags/docker/_index.md exists

In the above file I have:

---
slug: "docker-tips-tricks-and-tutorials"
title: "Docker"
description: |
  I've been using Docker since 2014. Along the way I've picked up a bunch of
  Docker experience and best practices. Here's what I learned.

params:
  heroTitle: "Docker Tips, Tricks and Tutorials"
---

Then I have this configuration:

taxonomies:
  tag: "tags"

permalinks:
  tags: "/blog/tag/:slug"

Here’s what’s working:

  • All of the tags get displayed as “Docker” or whatever their title is
  • I can access them at /blog/tag/docker-tips-tricks-and-tutorials.html

Here’s what’s not working, all of these fail with REF_NOT_FOUND:

  • {{% relref "/blog/tag/docker" %}}
  • {{% relref "/blog/tag/docker-tips-tricks-and-tutorials" %}}

Now, I did manage to figure out I have to do {{% relref "/tags/docker" %}} but I don’t know why. I pretty much brute forced a solution and arrived at a solution by sheer luck and determination. What is the general takeaway here?

Ref and relref work on content path not target url.

From the docs at Links and cross references | Hugo

The ref and relref shortcodes require a single argument: the path to a content document, with or without a file extension, with or without an anchor.

Which imho is suppoting the Markdown editor working on content files. How should he know where my complex config and layouts will finally render the page.

Interestingly I have content in content/blog/2024-07-23-hello-world.md but I’m able to use {{% rel "2024-07-23-hello-world" %}}, it works without blog/ being a part of the path.

Originally I thought maybe it was path based too but the above conflicts with that.

So it depends on the pages and ur ref. Without your sources hard to tell but also from that doc:

Paths without a leading / are first resolved relative to the current page, then to the remainder of the site.

Thanks. I think it’s the “relative to the current page” part that makes it work. All of my blog posts are in the same directory so the blog/ part isn’t necessary.