Still cannot make Hugo work for me

Continuing the discussion from Understanding Hugo taxonomy permalinks settings:

Hi there,

in my Hugo site I have

content/
└── en/
    └── properties/
        ├── _index.md
        ├── property1.md
        ├── property2.md
        └── ...

Page front matter is like this

<!-- content/en/properties/property1.md -->
+++
title = "Property 1"
date = 2023-08-01T00:00:00Z
properties = ["sale"]
+++
This is the content of Property 1 for sale.

Hugo generate multiple duplicates and when I click the generated url I see Page Not Found error.

My question is how can I setup so I have normal urls such as /properties/property1/ which I can filter based on the category “properties” without actually generating additional duplicate urls etc.

Thanks

Seems like Hugo generate url/ for each category which is not under the parent category such as
<url>

<loc>http://localhost:1313/properties/</loc>

<lastmod>2023-07-13T17:28:16+00:00</lastmod>

</url>

<url>

<loc>http://localhost:1313/properties/</loc>

<lastmod>2023-07-13T17:28:16+00:00</lastmod>

</url>

<url>

<loc>http://localhost:1313/rent/</loc>

<lastmod>2023-07-13T17:28:16+00:00</lastmod>

</url>

<url>

<loc>http://localhost:1313/sale/</loc>

<lastmod>2023-07-13T17:28:16+00:00</lastmod>

</url>

Should I better use page params such as

---
title: "Property 1"
date: 2023-08-01T00:00:00Z
draft: false
properties:
  params:
    category: sale
     type: residential
---

A taxonomy may not have the same name as a top-level content directory. We’ve been through this before.

1 Like

Hi @jmooring

I understand this but I am kind of forced to keep the url /properties/ how can I work around this.

I want to have the example.com/properties/

What else can I do to make this work are there headless categories which let me filter without generating duplicate pages.

how will you approach this can you please provide an example. I will really appreciate this.

Thanks

I suggest you spend some time thinking about your content model.

  • How many content types are there? Maybe just one (properties), but maybe not.
  • Which descriptors should be taxonomy terms, and which should be page parameters? Depends on whether or not you want automatic list pages, related items, etc.
  • Can a given descriptor (e.g., rental) be applied to two different property types (e.g., commercial and residential)

If you were doing this with WordPress or Drupal you would have to answer the same questions.

From your previous posts, it seems like you’re trying to start this project in the middle.