avillafiorita / jekyll-datapage_gen

Generate one page per yaml record in Jekyll sites.
367 stars 78 forks source link

Would it be possible to support nested collections? #119

Open Kralizek opened 1 year ago

Kralizek commented 1 year ago

I have a case like the following one:

customers:
  - name: Amazing Customer
    foo: bar
    projects:
       - name: P1
         bar: foo
       - name: P2
         bar: fizz
  - name: Brilliant Customer
    foo: bas
    projects:
      - name: P3
        bar: fritz
      - name: P4
        bar: fuzz

I would like to generate a page for each customer and a page for each project.

It would be even better if, when rendering a project, I could access the customer it belongs to. Something like page.parent.foo

daysleeperrr commented 1 year ago

I second this. It would be great to have nested directory support. In my usecase, I have a countries dataset and a regions dataset. It would be great to create URLs like /canada/ontario or /italy/tuscany/ instead of canada_ontario or italy_tuscany. Especially when also adding a third level, having multiple folders instead of /canada_ontario_toronto/ or /italy_tuscany_pisa/.

avillafiorita commented 1 year ago

Sorry for the late reply. I'll look into that

musicaldoctor commented 1 year ago

+1

In my case i'd love to be able to generate car make pages (e.g. citroen) and all the multiple model pages (e.g. C3). Of course this would also need the ability to use different templates for each of those objects.