Layout lookup: why `single.html.html` precedes `demolayout.html`

Hello, here an “understanding” question:

reading layout lookup rules https://gohugo.io/templates/lookup-order/#examples-layout-lookup-for-regular-pages (section “single page in section with layout set”), why does it have that single.html.html precedes demolayout.html?

layouts/posts/demolayout.html.html
layouts/posts/single.html.html
layouts/posts/demolayout.html
layouts/posts/single.html 

Does it break “most specific first” rule? Or is duplicate extension a way to additionally stratify the level of specificity?

Thanks!

layouts/posts/single.html.html

actually:

layouts/posts/single.[outputFormat].[suffix]

HTML Output Format, has html as suffix.
So yes it’s more specific than:

layouts/posts/demolayout.html

which translates to

layouts/posts/[layoutName].html

Nice Guide about template lookup order:

1 Like

Thanks @pamubay ! It clarifies things!

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