<guardian>
how do you guys typically use the snapshot feature?
drops has joined #nanoc
drops has quit [Quit: drops]
pkunc has joined #nanoc
VitamineD has joined #nanoc
pkunc1 has joined #nanoc
pkunc has quit [Ping timeout: 276 seconds]
alerante has joined #nanoc
VitamineD has quit [Quit: mi dormas]
cDlm has joined #nanoc
alerante has quit []
cDlm has quit [Ping timeout: 264 seconds]
cDlm has joined #nanoc
cDlm has quit [Ping timeout: 240 seconds]
cDlm has joined #nanoc
cDlm has quit [Ping timeout: 256 seconds]
cDlm has joined #nanoc
VitamineD has joined #nanoc
cDlm has quit [Ping timeout: 276 seconds]
VitamineD has quit [Ping timeout: 256 seconds]
srbaker has quit [Ping timeout: 245 seconds]
srbaker has joined #nanoc
VitamineD has joined #nanoc
VitamineD has quit [Ping timeout: 245 seconds]
VitamineD has joined #nanoc
tantalum has joined #nanoc
opatry has joined #nanoc
<opatry>
hi all
<opatry>
I'm already using nanoc
<opatry>
I'm trying to improve my layout parts
<opatry>
to do so, I tried to call layout 'mylayout' with extra parameters hash in my compile rule as follow:
<opatry>
compile '*'
<opatry>
layout 'mylayout', :do_nav => true
<opatry>
end
<opatry>
but I get this error "ArgumentError: wrong number of arguments (2 for 1)"
<opatry>
the #layout method allows several parameters (http://nanoc.ws/docs/api/Nanoc/Layout.html) but I assume this is not the layout method being called within this context
<opatry>
any idea to send extra parameters to layout from compile rule ?
prxq has joined #nanoc
<bobthecow>
opatry: the thing you linked to isn't a layout method, it's a layout class.
<opatry>
yes, I finally find out the involved layout parts
<bobthecow>
i was just going to point you to that.
<opatry>
it might be nice to allow extra params in the layout method of the compile rule, no?
<opatry>
(as the filter one)
<bobthecow>
you could do `rep.layout ...`
<bobthecow>
since the dsl `layout` method just passes through to rep.layout, which takes the additional args.
<bobthecow>
so call rep.layout directly :)
<bobthecow>
but yeah, that should prolly be consistent.
<bobthecow>
open an issue on the github repo?
<opatry>
I'll try that and if it works open an issue yes
irsol has quit [Ping timeout: 252 seconds]
<opatry>
I didn't understand how I can retrieve the given parameters, @my_param doesn't seems to be working
<opatry>
(using erb in my layout file)
<bobthecow>
oh, those options aren't for adding variables to your file.
<bobthecow>
those options are for the renderer.
<bobthecow>
just like the options in filter.
<bobthecow>
let's try this again. ask about what you're trying to accomplish, not about how you think you should be able to accomplish it ;)
irsol has joined #nanoc
FabianB_ has joined #nanoc
<opatry>
sure
<opatry>
the initial goal is to mutualize the layout of a single item between several use cases
<opatry>
- list of excerpt of items
<opatry>
- standalone item
<opatry>
a list of items' excerpt can be required for home page or more generally pagination pages and for tag pages
<opatry>
when inside a list I need to add link to item specific page at several places (and only layout the excerpt)
<opatry>
when inside a single item layout, I need to add prev/next links
<opatry>
everything work like a charm for now
<opatry>
but with duplication of item HTML layout between tag, home and single item page
<opatry>
giving some extra parameters from the compile Rule might help me to share all this stuff in the same layout and customize some part according to those parameters
<opatry>
(doing a for each loop on targeted items, excerpt management, adding the link_to when needed, next/prev when needed, …)
<opatry>
applying consecutive layout might help for some situation
<opatry>
calling render with some parameters might help in some other situations
<opatry>
I succeed in isolating common parts using partial layout rendered when needed
<opatry>
but at the price of ugly parameters forwarding from layout to partial