Hugo is not building URLs for a custom output format when the URL parameter is set in the pages frontmatter.
Front matter settings:
---
url: 2020.html
outputs:
- html
- gridview
---
Output settings:
[outputFormats]
[outputFormats.gridview]
mediaType = "text/html"
baseName = "gridview" # Does not seem to work if page us URL set manually in frontmatter
isPlainText = false
isHtml = true
noUgly = true
permalinkable = true
Tabbing here in the frontmatter is not an issue, and can confirm that this tabbing format does work on a content page without the URL parameter being set.
Thanks for the response @bep. Any plans in expanding on this functionality? Not a problem to change some of the content structure, just wanted to try this as a solution. Unless I missed it, I would suggested updating the documents to note that the URL param will override other settings such as output format.
In my most simplest understanding, when a URL parameter is set on a page, it overrides the baseName of a custom output format.
I’ve tested a few pages with and without URL present, and it seems to be the issue. However, the path setting in output format still works as expected when URL is set.
My memory is a little hazy, but the above kind of makes sense. The url front matter has always been a way to tell Hugo to use this as the URL instead of the permalinks and output format config etc. But you still get the other side effects of defining a output format.
replacing mediaType with a suffix param?
mediaType can be found via suffix, must be in suffixes too
suffix can overwrite the URL suffix
Can it used to find the right template ??