ddfreyne changed the topic of #nanoc to: 3.6.6 (nov 8th) | web http://nanoc.ws/ | repo http://bit.ly/XE6e3G | issues http://bit.ly/VfXaSV | forum http://ho.io/n-discuss | irclog http://irclog.whitequark.org/nanoc
bghost has joined #nanoc
jugglinmike has quit [Quit: Leaving.]
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…]
VitamineD has joined #nanoc
VitamineD has quit [Quit: VitamineD]
<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
<bobthecow> a helper method.
<dkm> but you are in fact generating nanoc items
<bobthecow> oh, you're creating index items that don't already exist?
<dkm> right, the blogger helper is just returning a subset of already generated items
<bobthecow> i thought you were just finding things that belong in an index.
<bobthecow> yeah, then create items in preprocess.
<dkm> bobthecow: that's how I understood jugglinmike's request
<bobthecow> it could be a data source, but that's a bit of a weird way to do it.
<dkm> ok, yeah, I kind of think of data sources as generating items from content outside of nanoc's scope
<dkm> or... no
<dkm> that wasn't really a good explaination of how I view data sources
<dkm> I think it kind of depends how we think of generating an index page
<jugglinmike> bobthecow: you're right there
<bobthecow> i'd do it like the way the "tag page" example does it.
<dkm> are we walking a directory structure on the file system, or are we iterating over a list of nanoc identifiers
<bobthecow> dkm: everything in nanoc is items.
<bobthecow> some of 'em just happen to be persisted to the filesystem :)
<dkm> bobthecow: yeah, I think the tag page is idea is very close to what the index page would be
louquillio has joined #nanoc
<dkm> bobthecow, jugglinmike: my new implementation https://github.com/hazybluedot/www-source/blob/master/lib/index_helper.rb
<dkm> I still created a layout for index_page because I don't like the idea of embeding html in the helper function
<dkm> oh woops, and I'm still hard-coding the identifier
<dkm> need to derive it from the path
tantalum has quit [Quit: Leaving]
<dkm> updated
<dkm> see line 26 in my Rules for where I use it in the preprocess block
<dkm> sorry, line 29
ics has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]