I have got this issue and thought about posting it here too.
In my hugo site I need to serve an index file that is generated from a template called index.json
. I also need to generate another file from a template called lastmod.json
So, following the documentation I came up with this config, which does not work. When accessing lastmod.json
instead of giving me the content of its template, the content of the first template is rendered instead.
[outputFormats.JSON-index]
baseName = "index"
isPlainText = true
mediaType = "application/json"
notAlternative = true
[outputFormats.JSON-lastmod]
baseName = "lastmod"
isPlainText = true
mediaType = "application/json"
notAlternative = true
What this leads me to believe is that you can only create one output format for every mediaType because if I use this configuration it works without any problems. But I wanted to have both files with the json extension.
[outputFormats.JSON-index]
baseName = "index"
isPlainText = true
mediaType = "application/json"
notAlternative = true
[outputFormats.JSON-lastmod]
baseName = "index"
isPlainText = true
mediaType = "application/lastmod"
notAlternative = true
[mediaTypes]
[mediaTypes."application/lastmod"]
suffix = "lastmod"
Is it possible to make both files end in .json? Thanks in advance.