ddfreyne changed the topic of #nanoc to: 3.7.5 (January 12th) | 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
irsol has quit [Remote host closed the connection]
irsol has joined #nanoc
FabianB has joined #nanoc
FabianB is now known as Guest25675
Guest13462 has quit [Ping timeout: 244 seconds]
cDlm has quit [Quit: mi dormas]
cDlm has joined #nanoc
pkunc has joined #nanoc
cDlm has quit [Quit: ĝis!]
jugglinmike has joined #nanoc
cDlm has joined #nanoc
cDlm has quit [Ping timeout: 250 seconds]
VitamineD has joined #nanoc
david____ has joined #nanoc
<david____> Hi guys
<david____> I have a question: I'd like to include some code in my Rules file which prevents the compilation of any pages dor which the label "created_at: 20-03-2015" is bigger then the current date. Basically this way I give drafts a created_at date in the year 3000 to avoid them getting included. Any pointers on how to tackle this?
<jugglinmike> david____: you could update the `route` block that iterates over these items to return early if @item meets your criteria
<jugglinmike> but the item will still be built.. you might instead try to find them in the `preprocess` block and remove them from the @items array there
<david____> That makes sense. But how?
<david____> Something like case @item.created_at > date.today?
alerante has joined #nanoc
<jugglinmike> david____: give it a try!
<jugglinmike> david____: Although be careful with that... nanoc will take notice that you are looking at the date as it computes its internal dependency graph
<jugglinmike> so the site will need to be re-built when that value changes
<david____> Hmm, any way to avoid that? Compilation takes 15 minutes as it is...
<jugglinmike> that sounds bad
<jugglinmike> well if you think about it from nanoc's perspective, this is a challenging problem
<jugglinmike> because all it knows is that some of your items depend on the current date
<jugglinmike> what you can do
<jugglinmike> I think
<jugglinmike> is first of all, make sure you're getting the date and not the time
<david____> Yes it is. Something to do with thumbnailing images through a ImageMagik filter..
<jugglinmike> I think if you can limit the items that you actually check for a `created_at` property, you can mitigate the re-building
<jugglinmike> in other words, if all the items whose publication status depend on time are in the same directory...
<jugglinmike> ...you can first check the directory of the item before referencing the current date
<jugglinmike> I *think* nanoc's internal dependency tracker will then correctly infer that *only* those items are dependent on the current date
<david____> All items are in the /posts/ directory
<david____> Any item with extension .md is to be checked for the date
<jugglinmike> So if I'm right about all that (I might not be), then you should be able to limit the daily re-building to items in the /posts directory with an .md extension
<david____> Sounds way over my head...
alerante has quit []
jugglinmike has quit [Ping timeout: 255 seconds]