bghost has quit [Read error: Connection reset by peer]
bghost has joined #nanoc
bghost has quit [Read error: Connection reset by peer]
m3nTe has joined #nanoc
m3nTe has joined #nanoc
m3nTe has quit [Changing host]
m3nTe has quit [Ping timeout: 272 seconds]
m3nTe has joined #nanoc
m3nTe has joined #nanoc
m3nTe has quit [Changing host]
m3nTe has quit [Quit: leaving]
VitamineD has quit [Quit: VitamineD]
VitamineD has joined #nanoc
jarr0dsz has joined #nanoc
VitamineD has quit [Quit: VitamineD]
VitamineD has joined #nanoc
guardian has quit [Ping timeout: 246 seconds]
guardian has joined #nanoc
guardian has quit [Ping timeout: 246 seconds]
Jutah has joined #nanoc
guardian has joined #nanoc
VitamineD has quit [Ping timeout: 264 seconds]
jarr0dsz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jugglinmike has joined #nanoc
VitamineD has joined #nanoc
FunkyPenguin has quit [Remote host closed the connection]
FunkyPenguin has joined #nanoc
jugglinmike has quit [Quit: Leaving.]
VitamineD has quit [Ping timeout: 240 seconds]
jugglinmike has joined #nanoc
louquillio_ has quit [Remote host closed the connection]
louquillio has joined #nanoc
louquillio has quit [Remote host closed the connection]
louquillio has joined #nanoc
VitamineD has joined #nanoc
<jugglinmike>
I want to create a "table of contents" page that lists links to all the pages in a given directory. I think that to do this, I would have to create a global array (say, `classes`) and push items into it in the `preprocess` block based on their `identifier` property (i.e. `if item.identifier[/^/training/classes]` ). Then, the "table of contents" layout could iterate over the `classes` array. Is that the best way to accompli
summatusmentis has left #nanoc [#nanoc]
koan has quit [Ping timeout: 246 seconds]
koan has joined #nanoc
koan has quit [Changing host]
koan has joined #nanoc
tantalum has joined #nanoc
yogsototh1 has quit [Ping timeout: 260 seconds]
VitamineD has quit [Quit: VitamineD]
ics has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<dkm>
In my case, I prefaced pages I wanted to be in the index with '_', although I could have also filtered the list of items to exclude the index itself, I think
louquillio has quit [Remote host closed the connection]
<jugglinmike>
I see dkm--thanks!
<jugglinmike>
I'm trying to remove the logic from my layouts, so I may go with the `preprocess` approach
<dkm>
yeah, I'm not necessarily in love with my implementation for that reason
<dkm>
although in this case, I think of it less as "logic" and more of "generation of content at compile time"
<dkm>
a slippery slope, to be sure!
<dkm>
one could also have philisophical issues with creating a global array of items that really wasn't logically global
VitamineD has joined #nanoc
<bobthecow>
jugglinmike: i tend to move logic like that into helpers in lib.
<bobthecow>
i have an `articles` method, a `projects` method, etc.
<jugglinmike>
dkm: I think we could debate that, but unfortunately, I'm preoccupied at the moment :P
<dkm>
bobthecow: I like that, then jugglinmike could create a method like #get_index_for(item) or something
<bobthecow>
yeah.
<dkm>
I might change my implementation to do that, thanks for the idea!
<bobthecow>
except the "get" part isn't very ruby.
<bobthecow>
just index_for
<dkm>
ah, ok
ics has joined #nanoc
VitamineD has quit [Quit: VitamineD]
<jugglinmike>
bobthecow dkm: This function sounds interesting, but I'm not sure I understand. Which item would I pass to `index_for` ? The "table of contents" item? And I guess it would return an array of all the items that belonged?
<dkm>
jugglinmike: perpahs it would be an 'item' but a path
<dkm>
#index_for(path)
<dkm>
which would return an array of items
<dkm>
the index page would still have to iterate over a list of items to generate an index item
<dkm>
but I suppose you could put *that* in a pre-process step
* dkm
hurriedly begins completely refactoring his entire site
<dkm>
hmm, I wonder if it makes sense to make this a DataSource?
<dkm>
IndexDataSource#up would walk through the directories in /content, creating an index page for each subdirectory, IndexDataSource#items would then return the array of index page items
<dkm>
you'd probably want a way to exclude a subset of subdirectories from the indexer
<bobthecow>
dkm: iterating over a list of items in memory is *really* fast.
<bobthecow>
that'sunlikely to be a bottleneck for you.
<dkm>
bobthecow: I'm just thinking in terms of what would be most nanocic