alerante has quit [Remote host closed the connection]
cDlm has quit [Read error: Connection reset by peer]
cDlm has joined #nanoc
yogsototh has joined #nanoc
cDlm is now known as VitamineD
skroon_ has quit [Ping timeout: 240 seconds]
skroon has quit [Ping timeout: 264 seconds]
VitamineD has quit [Read error: Connection reset by peer]
cDlm has joined #nanoc
cDlm has quit [Read error: Connection reset by peer]
jeremyjarvis has joined #nanoc
skroon_ has joined #nanoc
skroon has joined #nanoc
dbast has quit [Quit: '']
dbast has joined #nanoc
skroon_ has quit [Quit: leaving]
jeremyjarvis has quit [Quit: jeremyjarvis]
jeremyjarvis has joined #nanoc
jugglinmike has joined #nanoc
alerante has joined #nanoc
alerante has quit [Read error: Connection reset by peer]
alerante_ has joined #nanoc
alerante_ has quit [Remote host closed the connection]
skroon has quit [Ping timeout: 276 seconds]
<jugglinmike>
Hey all
<jugglinmike>
Is there a way to use a filter from within a layout?
<jugglinmike>
for instance
<jugglinmike>
I'd like for this include
<jugglinmike>
<%= @item[:register] %>
<jugglinmike>
to be processed with ERB
<jugglinmike>
In other words, the string stored in `@item[:register]` is itself an ERB template
<summatusmentis>
at the end of my Rules file, there's the line: layout '*', :erb
<summatusmentis>
but I'm not sure how deep that goes
<summatusmentis>
I realized as I was saying this that maybe it doesn't address your issue
<summatusmentis>
you might need to compile the item using erb first
<bobthecow>
yeah, no. things don't double-evaluate like that. it's just dangerous :)
<bobthecow>
you can prolly use the filtering helper.
<bobthecow>
something like
<bobthecow>
<% filter :erb %><%= @item[:register] %><% end %>
<bobthecow>
it might need to be <%= filter ... i don't know offhand.
<bobthecow>
try both.
<bobthecow>
jugglinmike: ^
jeremyjarvis has quit [Quit: jeremyjarvis]
<jugglinmike>
Thanks, bobthecow!
<jugglinmike>
also summatusmentis :)
<summatusmentis>
I didn't do anything, don't thank me :)
jachymko is now known as jachymko[afk]
Evolution has joined #nanoc
<Evolution>
could someone help me out a bit with a Rules for building a robots.txt
<Evolution>
google's not being helpful, and the examples I'm finding aren't working quite right
<Evolution>
oh, rock. nevermind I worked it out
<Evolution>
you guys are great!
<summatusmentis>
glad to help :)
<Evolution>
;-)
tantalum has joined #nanoc
<ddfreyne>
jugglinmike: <% filter :erb do %> -- don't forget the do there
<ddfreyne>
you also need to include Nanoc::Helpers::Filtering
<ddfreyne>
and it's <% not <%=
<ddfreyne>
Now that I think about it, I guess <%= filter :erb, @item[:register] %> should also be possible (but currently isn't)
<jugglinmike>
aha! Thank you ddfreyne. Unfortunately, my coworker found an even grosser solution
<jugglinmike>
which is to conditionally emit the value from the layout itself
<jugglinmike>
:/
<ddfreyne>
myeah :D
<tantalum>
Hi,
<tantalum>
In my setup, in Rules, the compile rule the layout is set to 'default'
<tantalum>
is there a way to set the layout in the item it self?
<tantalum>
basically I have a couple of random pages that need a special layout
<summatusmentis>
you should be able to in the yaml block at the top of the item
<tantalum>
summatusmentis: Sweet... Is there a doc that explains what all can go into the yaml block?
<summatusmentis>
I'm not sure
<summatusmentis>
although, I just tested on my site, and I'm not certain the yaml block actually does it
<summatusmentis>
in Rules, I've also got specific compile rules for certain items
<ddfreyne>
tantalum: You can basically put anything what you want in there; nanoc does not really care
<ddfreyne>
Some helpers have assumptions about what's in there, but not a lot
<tantalum>
ddfreyne: I understand... My main issue is that I wanted to know if I could define a layout in an item instead of having to write a Rule
<ddfreyne>
tantalum: Yes, you can
<tantalum>
Sweetness
<ddfreyne>
tantalum: put something like "layout_name: default" in the attributes, and inside the compile block you can use "layout @item[:layout_name]"
<ddfreyne>
(layout_name does not have a special meaning to nanoc)
<summatusmentis>
ooh
<summatusmentis>
that's slick
<summatusmentis>
I'm always surprised by how flexible all this can be