Json output based on type

If I set the layout type in an _index.md in a third or fourth level directory to say “city” then I may expect the json output to reflect layouts/city/list.json.json?

The output appears to be inconsistent so I am wondering whether my understanding is wrong.

e.g. for Rajasthan I get some default template (have to double check which one):

    {
    	"data": 
    {     
      "count" : "34"
      ,"items" : [

for west bengal I get the template I want:

    {
    	"data": 

    {     
      "test" : "layouts/cities/list.json.json",
      "count" : "9",
      "items" : [

Hugo Static Site Generator v0.74.3
source is on git@github.com:ourmaninindia/odyssey-tours.git

Formatting man, please :slight_smile: tripple backticks for code blocks, single backticks for code inline.

Anyways… If a frontmatter layout property says city on any level of depth in the content then I would expect layouts/_default/city.json to be used.

A list.json file is not used for a frontmatter layout parameter. That’s something that is used for single views only, not list views.

You might want to put a simple sample up online to make your case clearer.

Oops I had forgotten about the formatting (late at night here). I have now immediately paid my penance by following the new online course to refresh some of the stuff :slight_smile:

I had another fresh look at the docs and I managed to solve it by changing the file names to:

layouts/_default/list.json
layouts/city/list.json.json

The extra json increased the priority enabling me to custom write a json template to what I was after.

The problem with many depth levels is that all the standard json files are indeed list views making retrieval of data at times unnecessarily complicated,