Generate category like pages in Hugo from frontmatter

Hi there,

Is it possible in Hugo to generate pages based on front matter. I am working on my real estate website and in the front matter I have.

propertytype: Residential
location: New York, Mid-Atlantic, New York, United States

So this should be able to generate these pages

  └── en
     ├── residential-properties-for-sale-in-manhattan
     |   └──
     ├── residential-properties-for-sale-in-region-mid-atlantic
     |   └──
     ├── residential-properties-for-sale-in-state-new-york
     |   └──
     └── residential-properties-for-sale-in-usa


These are not pages but a directory structured with Markdown files. I very much doubt that that’s what you’re after.

And if Hugo could generate this structure, what would that give you? Only some MD files. You’d have to run Hugo a second time to get HTML. But how would Hugo even know that this time you don’t want the directory structure but HTML?

Also, why is New York appearing twice in ‘location’? And how would you get from “New York” to “New Yorl State”? Where should Manhattan suddenly come from if it’s not in the front matter?

Hi @chrillek

The values are in this format City, Region, State, Country. (this was just to give an example) the main question is if it is possible.

It is a question I ask, I do not know if possible but since Hugo generate category and tag pages. I am wondering if Hugo can be tweaked in some way to generate pages using front matter values.


Using taxonomies, yes. But then you shouldn’t put the terms all in one field (location). Rather split them up into different fields like country, state, city