Template lookup order for baseof broken in 0.146?

The following configuration worked in pre 0.146.0 versions. I could define specific baseof templates for different output formats. This now seems to be broken.

For my home page index.html Hugo generated html and for index.print.html Hugo generated print.
Since 0.146.0 both files contain html.

[outputs]
  home = ['html', 'rss', 'print']
  section = ['html', 'rss', 'print']
  page = ['html', 'rss', 'print']

[outputFormats]
  [outputFormats.print]
    name= 'print'
    baseName = 'index.print'
    isHTML = true
    mediaType = 'text/html'
    permalinkable = false
    noUgly = true

layouts/_default/baseof.html

html

layouts/_default/baseof.print.html

print

I also tried other combinations of baseof.html.html, baseof.print to no avail.

I was not able to reproduce this. Please have a look at this test site, and tell me what I need to do to reproduce the problem.

git clone --single-branch -b hugo-forum-topic-54306 https://github.com/jmooring/hugo-testing hugo-forum-topic-54306
cd hugo-forum-topic-54306
hugo server

On the home page there are links to each page, in each output format. On those pages you will see green text in brackets that indicates which templates were used.

A post was split to a new topic: Tempalte lookup problem with v0.146.1

I can reproduce it with your example by deleting home.print.html, list.print.html and single.print.html

This looks like a bug: regression: baseof.print.html vs list.html · Issue #13583 · gohugoio/hugo · GitHub

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.

This was fixed in v0.146.2.

1 Like