Is this apparent conflicting baseof order a bug or just a misunderstanding?

Let’s say I have the following:

  • file 1: layouts/_default/baseof.html, which includes {{ partial "head.html" . }}
  • file 2: themes/my-theme/layouts/_default/baseof.html, which includes {{ partial "head.html" . }}
  • file 3: layouts/partials/head.html
  • file 4: themes/my-theme/layouts/partials/head.html

If I delete file 3, file 4 is used as head.html, which is the expected result.

If I delete file 1, file 2 is used as baseof.html, which is also the expected result.

However, if I delete file 1, file 4 is used as head.html, which is not what I expected. Is this a bug? I’m unclear on if the documentation indicates that this is what should happen based on the template order.

I am unable to reproduce the problem. Try this:

git clone --single-branch -b hugo-forum-topic-34063 hugo-forum-topic-34063
cd hugo-forum-topic-34063
hugo server