2

I'm building a website with nanoc. I have my main index file and now I want to add a article section with some articles I've written. So I use:

nanoc create_item articles

to create this new section, but how do I create new items within this item I just created?

The url tree I want to achieve would be:

index.html
/articles/index.html
/articles/one.html
/articles/two.html

I now this is very basic stuff but I can't find any examples on the nanoc documentation.

eliocs
  • 18,511
  • 7
  • 40
  • 52

1 Answers1

3

You can use nanoc create_item articles/two, or you can simply create /articles/two.html manually. The create_item command is there for your convenience but you can easily create items by hand as well.

Denis Defreyne
  • 2,213
  • 15
  • 18
  • Thanks! What would you do to create a dynamic listing of all the items which belong to the articles directory? – eliocs Nov 13 '11 at 12:18
  • 2
    If `@item` is the articles item, then `@item.children` will give you the items below the `/articles/` item. Otherwise, find the articles item using `@items.find { |i| i.identifier == '/articles/' }`. – Denis Defreyne Nov 13 '11 at 17:55