# Nesting Content

**URL:** https://discourse.gohugo.io/t/nesting-content/2611
**Category:** support
**Created:** [February 4, 2016, 5:23am UTC](https://discourse.gohugo.io/t/nesting-content/2611 "2016-02-04T05:23:22Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![emarthinsen](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/emarthinsen/32/1212_2.png) [@emarthinsen](https://discourse.gohugo.io/u/emarthinsen)
#### Post date: [February 4, 2016, 5:23am UTC](https://discourse.gohugo.io/t/nesting-content/2611/1 "2016-02-04T05:23:23Z")

</div>

Sorry if this has been addressed, but here goes.

I have a section for products. I want to group articles that are related to that product “underneath” the product page. To clarify, here’s what the full path to one of the articles might look like:

`/product/pet_rock/articles/care_and_feeding`

I’d like to group the articles underneath the product section, since each product might have a very similarly named article (e.g. getting-started).

I imagine that the directory structure might look something like this:

```
content/
  product/
    pet-rock/
      article/
        care-and-feeding.md

```

I’m not sure where the actual product page would go (maybe `content/product/pet-rock.md`?)

Is this possible? And, what would my content directory structure look like?

Thanks!

---

<div class="post-metadata">

### Author: ![moorereason](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/moorereason/32/592_2.png) [@moorereason](https://discourse.gohugo.io/u/moorereason)
#### Post date: [February 4, 2016, 1:59pm UTC](https://discourse.gohugo.io/t/nesting-content/2611/2 "2016-02-04T13:59:23Z")

</div>

You’re on the right track. That sounds like it would work. You can also create `content/product/pet-rock/index.md` for the product page.

---

<div class="post-metadata">

### Author: ![emarthinsen](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/emarthinsen/32/1212_2.png) [@emarthinsen](https://discourse.gohugo.io/u/emarthinsen)
#### Post date: [February 5, 2016, 4:47am UTC](https://discourse.gohugo.io/t/nesting-content/2611/3 "2016-02-05T04:47:55Z")

</div>

What are your thoughts about being able to display the subset of articles that are nested underneath the product? Would I need to wire them up with some sort of tag/value in the articles’ frontmatter, or is there a way to get an array of pages that sit beneath a certain path?

---

<div class="post-metadata">

### Author: ![marcedwards](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/marcedwards/32/699_2.png) [@marcedwards](https://discourse.gohugo.io/u/marcedwards)
#### Post date: [February 5, 2016, 10:26am UTC](https://discourse.gohugo.io/t/nesting-content/2611/4 "2016-02-05T10:26:38Z")

</div>

I have a site that’s similar and it works well (you can set the layout in the front matter, too).

My issue is that this structure:

```auto
content/
  product/
    pet-rock/
      article/
        care-and-feeding.md

```

…generates some 0 byte HTML files:

```auto
product.html
product/petrock.html
product/petrock/article.html

```

(Worth noting: I have ugly URLs on because we have some htaccess rules set up already.)

---

<div class="post-metadata">

### Author: ![moorereason](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/moorereason/32/592_2.png) [@moorereason](https://discourse.gohugo.io/u/moorereason)
#### Post date: [February 5, 2016, 9:09pm UTC](https://discourse.gohugo.io/t/nesting-content/2611/5 "2016-02-05T21:09:39Z")

</div>

@emarthinsen, it sounds like you need to use taxonomies.

---

<div class="post-metadata">

### Author: ![emarthinsen](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/emarthinsen/32/1212_2.png) [@emarthinsen](https://discourse.gohugo.io/u/emarthinsen)
#### Post date: [February 5, 2016, 9:30pm UTC](https://discourse.gohugo.io/t/nesting-content/2611/6 "2016-02-05T21:30:07Z")

</div>

Cool. I’ll give that a shot.

---

<div class="post-metadata">

### Author: ![jpincas](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jpincas/32/1157_2.png) [@jpincas](https://discourse.gohugo.io/u/jpincas)
#### Post date: [February 7, 2016, 1:02pm UTC](https://discourse.gohugo.io/t/nesting-content/2611/7 "2016-02-07T13:02:30Z")

</div>

If I understand correctly, sounds like you are trying to do more or less what I was trying to do when I asked this question:

> **[Nested Content](https://discourse.gohugo.io/t/nested-content/2517)**
>
> Hi guys. Just getting started with Hugo and trying to fully understand the philosophy regarding content organisation. On initial reading of the docs, it seemed it would be trivial to lay out my website, which has multiple nested subcategories. I...

As @moorereason suggested, I ended up going with taxonomies as Hugo only generates a list view for the top level section (‘product’ in your case).

Interesting aside: as my site navigation depends only on the taxonomies now, I decided to use the ‘redundant’ product list view to implement search functionality with the excellent isotope.js used to filter the list of all products by whatever the user types in the search box. Works pretty well and almost instant results for my use case (500 products)!
