ddfreyne changed the topic of #nanoc to: 3.6.7 (dec 9th) | 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
<Evolution> ddfreyne: it was blank.
<Evolution> sorry for the delay again. last couple days have been stupidly busy
<Evolution> (although we made the news, so that was nice)
<Evolution> just got off a plane back home
pavelkunc has quit [Quit: Leaving.]
VitamineD has quit [Quit: VitamineD]
alerante has joined #nanoc
jugglinmike has quit [Quit: Leaving.]
alerante has quit [Remote host closed the connection]
tom][ has joined #nanoc
smkelly_ has joined #nanoc
tom[] has quit [*.net *.split]
smkelly has quit [*.net *.split]
tom][ is now known as tom[]
smkelly_ is now known as smkelly
alerante has joined #nanoc
alerante has quit [Remote host closed the connection]
alerante has joined #nanoc
alerante has quit [Ping timeout: 252 seconds]
pavelkunc has joined #nanoc
relix has joined #nanoc
alerante has joined #nanoc
alerante has quit [Ping timeout: 252 seconds]
pavelkunc has quit [Quit: Leaving.]
VitamineD has joined #nanoc
alerante has joined #nanoc
alerante has quit [Ping timeout: 252 seconds]
FunkyPenguin has quit [Ping timeout: 246 seconds]
FunkyPenguin has joined #nanoc
FunkyPenguin has quit [Excess Flood]
FunkyPenguin has joined #nanoc
FunkyPenguin has quit [Excess Flood]
FunkyPenguin has joined #nanoc
FunkyPenguin has quit [Ping timeout: 260 seconds]
FunkyPenguin has joined #nanoc
FunkyPenguin has quit [Ping timeout: 264 seconds]
FunkyPenguin has joined #nanoc
VitamineD has quit [Quit: VitamineD]
gerwitz has joined #nanoc
jugglinmike has joined #nanoc
VitamineD has joined #nanoc
pavelkunc has joined #nanoc
smkelly has quit [Excess Flood]
smkelly has joined #nanoc
jugglinmike has quit [Quit: Leaving.]
jugglinmike has joined #nanoc
alerante has joined #nanoc
alerante has quit [Client Quit]
dkm has quit [Ping timeout: 240 seconds]
dkm has joined #nanoc
dkm has quit [Ping timeout: 264 seconds]
gerwitz has quit [Remote host closed the connection]
gerwitz has joined #nanoc
VitamineD has quit [Read error: Operation timed out]
gerwitz has quit [Remote host closed the connection]
gerwitz has joined #nanoc
<relix> hey, what does item.children do?
<bobthecow> gets the children of the item.
<relix> what are the children of the item?
<relix> I've searched high and low in the docs but can't find anything on that
<bobthecow> it's the equivalent to files in a subfolder...
<bobthecow> item with id /foo/
<bobthecow> would have children with ids /foo/*/
<bobthecow> if any.
<relix> that's interesting, a shame there's nothing (easily findable) about that in the docs
<relix> I thought items are only files never folders
<bobthecow> items are files.
<bobthecow> that's why i said "equivalent"
<bobthecow> for example, i have a "tag.erb" item in my site: http://justinhileman.info/tag/
<bobthecow> its children are all the tag items, i.e. /tag/*/
<relix> so you generate the children yourself, in a preprocessor?
<bobthecow> yeah.
<relix> oh
<bobthecow> in this case. but not all cases...
<relix> I thought I could use that functionality to add pictures to my items
<bobthecow> you can.
<bobthecow> just put them in a folder with the same name as the item.
<relix> they'll automatically become child items? cool
<bobthecow> yep.
<bobthecow> basically, it walks through the items and sets their parent link if there's an item with an identifier one "directory" above the item's identifier.
<bobthecow> and adds that item to the parent's children.
<bobthecow> the one caveat to this is, for example, if you have an item /foo/ and a bunch of /foo/bar/*/ items, but no /foo/bar/, there's no parent/child link.
<bobthecow> since there's no item in the middle, the chain is broken.
<relix> ah right
<relix> thanks!
<relix> I think I won't make it automatically though, it feels wrong to litter the directory that has the "pages" with directories of images for each page
<relix> I think I'll run a preprocessor to add the items /assets/foo/* as children for /foo/
<bobthecow> i would add them to a different property.
<bobthecow> the parent/child relationship should be treated as read only.
<bobthecow> it's regenerated periodically.
<bobthecow> one thing you can do is make your pages index.html
<relix> oh ok
<relix> ah right, have a directory for each item
<bobthecow> so you'd have a directory full of /foo/index.html, /foo/someimage.png
number-six has quit [Remote host closed the connection]
<bobthecow> then you'd have content files hanging out with assets and the parent/child relationship would work.
number-six has joined #nanoc
<relix> bobthecow yep that sounds nice
<bobthecow> ddfreyne: feature request: instead of having the index magic handling at the filesystem data source level, can we specify "directory index" id slugs that are automatically treated as parents? Equivalent to apache's DirectoryIndex config option?
<bobthecow> then /foo/index/ from any data source would be magic for /foo/
VitamineD has joined #nanoc
<relix> so I've got /foo/index.html and /foo/someimage.png
<relix> can I reference the /foo/index item from /foo/someimage?
<relix> because I'm using index.html metadata to route it, which is not available to someimage
<relix> ah parent probably
<bobthecow> yep.
<bobthecow> as you would expect, the parent/child relationship is symmetric.
VitamineD has quit [Quit: VitamineD]
<relix> hmm
<relix> I'm getting some weird results for this one file now
<relix> so let's say /foo/index.html and /foo/bar1.png, bar2.png etc
<relix> index.html gets updated twice during the compilation process
<relix> one update
<relix> then the images are processed
<relix> and then foo/index.html is updated again, with a [-0.17s] in the log added for that file
<relix> the file itself appears empty as well
<relix> as if item.attributes were emptied
<relix> the layout is there
<relix> update output/2013/11/19/a-poor-mans-javascript-error-logger-using-google-analytics/index.html
<relix> update [-0.10s] output/2013/11/19/a-poor-mans-javascript-error-logger-using-google-analytics/index.html
<relix> ah probably another item that uses the same path
<relix> damn! of course
<relix> yep found it
<relix> thx for being a rubber duckie
VitamineD has joined #nanoc
<bobthecow> :)
pavelkunc has quit [Quit: Leaving.]
<bobthecow> i was going to ask that.
VitamineD has quit [Quit: VitamineD]
alerante has joined #nanoc
VitamineD has joined #nanoc
VitamineD has quit [Client Quit]
VitamineD has joined #nanoc
gerwitz has quit [Remote host closed the connection]
gerwitz has joined #nanoc
gerwitz has quit [Remote host closed the connection]
gerwitz has joined #nanoc
gerwitz has quit [Remote host closed the connection]
gerwitz has joined #nanoc
<ddfreyne> bobthecow: The index logic is gone in nanoc 4.0
<ddfreyne> So that should solve your issue :D
<ddfreyne> (that also means the parent/children stuff is not defined anymore, because it's hard to find the parent of /foo/bar.md if you have /foo.md, /foo.erb etc)
<relix> ddfreyne
<relix> aww he's probably gone again
<relix> if /foo/index.md and /foo/img1.png
<relix> how can I best compile img1.png twice (once original size, once thumbnailed)
<bobthecow> relix: you do that by making a separate :thumb rep
<relix> bobthecow yep, but I can't pinpoint the images without the index.md as well
<bobthecow> that's the answer for "how do i make two of x" for any value of x.
<relix> can I just ignore "if not item.binary?"
<bobthecow> ohhh. yeah, you'd route the non-binary ones to nil.
<bobthecow> that would keep the second rep from compiling.
<bobthecow> depends though.
<bobthecow> you could route with regex as well, but that's probably not what you want to do.
<bobthecow> so i'd stick with the binary switch.
<relix> bobthecow so if I route a file to nil it will stop the other presentations as well? shitty
<bobthecow> no, you route the rep to nil.
<bobthecow> then it will only be compiled if its compiled content is a dependency of something else.
<bobthecow> for example: http://justinhileman.info/projects/
<bobthecow> the list of github projects at the bottom are all items.
<bobthecow> but they're routed to nil.
<bobthecow> then i use the compiled content of them in this index-style page.
<relix> ah I see
<bobthecow> so they're still compiled, just not compiled to a file.
<relix> yep, I got it
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]