ddfreyne changed the topic of #nanoc to: 3.6.2 (mar 23th) | 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
pavelkunc has quit [Quit: Leaving.]
alerante has quit [Remote host closed the connection]
alerante has joined #nanoc
louquillio has joined #nanoc
tokeep has joined #nanoc
<tokeep> does anyone know how to add nanoc into my path for Arch with the Raspberry Pi?
<tokeep> cant seem to get it using PATH=$PATH:
<tokeep> i usually use ubuntu and not well at that
<tokeep> i have read the site
<tokeep> my gem is 2.0.0
<tokeep> i used both PATH="$/var/lib/gems/2.0.0/bin"
<tokeep> and PATH="$:/var/lib/gems/2.0.0/bin"
tokeep has quit [Read error: Connection reset by peer]
tokeep has joined #nanoc
tokeep has quit [Ping timeout: 264 seconds]
kitallis has joined #nanoc
yogsototh has joined #nanoc
<guardian> o/
<ddfreyne> hai
yogsototh has quit [Ping timeout: 246 seconds]
yogsototh has joined #nanoc
yogsototh has quit [Ping timeout: 252 seconds]
hakunin has joined #nanoc
musicmat1e has joined #nanoc
hakunin_ has quit [*.net *.split]
musicmatze has quit [*.net *.split]
<guardian> hmm I don't remember why I added gem 'rb-fsevent', '~> 0.9.1'
<guardian> looks like it's related to the "listen" gem, required by nanoc watch
<guardian> does that ring a bell?
<guardian> aren't dependencies transitive? https://github.com/guard/listen/blob/master/Gemfile
<matjas> I would like my tag URLs to be all lowercase, i.e. not http://example.com/tag/MySQL but http://example.com/tag/mysql. What’s the best/easiest way to do this in nanoc?
<guardian> matjas: string.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '')
<guardian> matjas: that's my implementation of to_slug(string)
<guardian> matjas: I felt I didn't need to depend on another gem just for that since I'm writing everything in English so doing string.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '') is enough to slugify something
<matjas> guardian: cool, but where do i put this? (i'm new to nanoc, obviously)
<matjas> first i thought i'd have to override http://nanoc.ws/docs/api/Nanoc/Helpers/Tagging.html#link_for_tag-instance_method somehow
<guardian> matjas: you're using the tagging helper?
<matjas> guardian: i think so, yeah :D
<guardian> matjas: http://pastebin.com/CaP5Tupt
<guardian> matjas: you can provide your own link_for_tag in lib/foo.rb or whatever source file you put in lib/
<matjas> awesome, thanks so much guardian!
<guardian> np
<matjas> guardian: hmm, now when i click a tag link and go to the correctly slugified tag URL, it doesn’t show any posts
<matjas> should i be defining those mapping somehow?
<matjas> i think nanoc doesn’t realize 'mysql' is the slug for the 'MySQL' tag
<guardian> you may need to adapt the link_for_tag implementation, I think I deviated to what stock helpers do
<matjas> ah, just had to modify the route
<matjas> thanks!
yogsototh has joined #nanoc
alerante has quit [Ping timeout: 255 seconds]
<ddfreyne> matjas: Yep
<ddfreyne> matjas: '/tags/*' also matches the item '/tags/' itself though, so be aware of that
<matjas> ddfreyne: thanks for the heads up
alerante has joined #nanoc
yogsototh has quit [Ping timeout: 246 seconds]
yogsototh has joined #nanoc
julian37 has joined #nanoc
yogsototh1 has joined #nanoc
yogsototh has quit [Ping timeout: 246 seconds]
jugglinmike has joined #nanoc
julian37 has quit [Ping timeout: 245 seconds]
kitallis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
julian37 has joined #nanoc
julian37 has quit [Read error: Operation timed out]
julian37 has joined #nanoc
julian37 has quit [Remote host closed the connection]
julian37 has joined #nanoc
julian37 has quit [Ping timeout: 240 seconds]
musicmat1e is now known as musicmatze
musicmatze is now known as muma
muma is now known as musicmatze
louquillio_ has joined #nanoc
louquillio_ has quit [Remote host closed the connection]
louquillio_ has joined #nanoc
julian37 has joined #nanoc
yogsototh1 has quit [Ping timeout: 248 seconds]
julian37 has quit [Ping timeout: 248 seconds]
julian37 has joined #nanoc
alerante has quit [Remote host closed the connection]
alerante has joined #nanoc
<darix> can you assign a template in a compile rule?
julian37 has quit [Ping timeout: 245 seconds]
<Rym> darix: if template is layout, yes? -- layout 'layoutname'
<darix> naw.
<darix> the stuff it should render inside the template
<darix> but it seems i need a filter anyway
<Rym> ok!
<darix> i was hoping for something like template: 'foo'\nlayout 'default'
<darix> but it doesnt want to render my binary item object for the image as text anyway
<darix> although all the data is available in the metadata of the item
<darix> hm
<guardian> bobthecow: can you show me again how your production? helper is implemented? I just kept http://i.0x7f.us/Screen_Shot_2013-03-10_at_10.50.15_PM-20130310-225200.png and http://i.0x7f.us/Screen_Shot_2013-03-10_at_10.48.51_PM-20130310-224931.png
<guardian> bobthecow: looks like one is missing
<guardian> ddfreyne: did you notice my question about listen en rb-fsevent?
<guardian> ddfreyne: nanoc says Missing dependency 'rb-fsevent' (version '~> 0.9')!
<guardian> ddfreyne: when I remove rb-fsevent from my gemfile. what I don't get is that I require listen, and I thought it would be transitive
julian37 has joined #nanoc
julian37 has quit [Ping timeout: 260 seconds]
<bobthecow> ddfreyne: yes. mention issues. here's what i do for Genghis — http://genghisapp.com/changelog/
<bobthecow> guardian: hrm?
<guardian> we discussed about how to populate config defaults with env
<guardian> but in fact I think I'll have 3 separate settings in config: for css, js and html minification
<bobthecow> i use debug? for that.
<guardian> and have preprocess override those defaults if ENV contains NANOC_ENV set to production
<bobthecow> and the env settings for prod/dev switches.
<guardian> not sure I need both debug? and production?
<bobthecow> i have different levels of crazy depending on those two settings.
<guardian> well I think, even when developing the site further, I want everything to be minified anyways: best way to early see if minification messes things up
<Rym> darix: do you have a gist for what you're attempting perhaps? or more detail?
<bobthecow> right. that's what i'm doing.
<bobthecow> debug? is for when minification is hiding something or i want to view compiled but not minified source.
<bobthecow> but most dev is done with debug==false and env==development
<guardian> what difference do you make?
<guardian> compiled but not minified?
<darix> Rym: gallery module. i have foo.jpeg and foo.yaml
<darix> foo.yaml has all exif data
<darix> so i want to have /foo/index.html
<bobthecow> things are deleted in preprocess if production?
<bobthecow> everything's always compiled.
<bobthecow> things are minifed unless debug?
<darix> generated by (:rep => :html)
<guardian> oh
<darix> which renders foo.jpg + the exif metadata from foo.yaml
<guardian> yeah I have @items.delete_if { |item| item[:publish] == false } in preprocess but I don't even use it
<guardian> it's there because I saw others do it when I began
<guardian> bobthecow: I think I don't even need to hide, remove things if I feel the need to fix something and ship — isn't that the job of fix branch + rebase dev?
bghost has joined #nanoc
<Rym> darix: pm me the related rules :)
<darix> Rym: later. busy atm
<Rym> sure
<bobthecow> guardian: depends.
<bobthecow> we have dev resources (style guides, etc) that aren't shipped, but are always there.
<guardian> I see
<guardian> ok need to recap. @config[:minification][:css] set in config.yaml as default value. then in preprocess if production? ensure minification is set to true unless debug? in which case force minification to false?
<guardian> maybe that's over engineered already. have config switches for each minification (css, js, html) always set to true (and committed as is) and revert back one of them in case something breaks
<guardian> debug? doesn't offer enough granularity — and about production? for now I don't need to filter out parts
<bobthecow> YAGNI
<guardian> YAGNI which part? separate control over css, js, html minification?
<bobthecow> overengineering all of this :)
<guardian> or the convoluted combination of production? and debug? :)
<bobthecow> yeah.
<bobthecow> the only thing we use production? for is removing items that aren't present while in production.
<guardian> yeah not sure config switches are even needed
<bobthecow> and the only thing we use debug? for is toggling minification for when things start breaking.
<guardian> it's: config switches VS comment Rules temporarily
<bobthecow> and we use those directly in the rules.
<bobthecow> so the rule says `filter :uglify_js unless debug?`
<bobthecow> etc.
<guardian> but could be comment filter :uglify_js is really something breaks with js minification
<guardian> s/is/if
<bobthecow> true.
<bobthecow> that works too.
<bobthecow> we've got lots of rules though.
<bobthecow> so it's easier to change `debug: true` in nanoc.yaml :)
<bobthecow> 6 rules files and counting.
<guardian> indeed
tracphil has joined #nanoc
<Keltia> meow
<Keltia> ddfreyne: ping
<Keltia> bobthecow: I have another problem for you :)
<bobthecow> yay!
<Keltia> a variation on the discussion I had yesterday with ddfreyne
<Keltia> instead of a bit .md file filled with <% render .... %>, I'm trying what's in the gist
<Keltia> s/bit/big/
<guardian> do you put output in scm?
<guardian> would be handy if something changed in there, and if yes, what
<Keltia> guardian: non
<guardian> however, with static items copied over, that would cause duplication
<Keltia> guardian: that would be with a different path so no issue there but I doon't see the point
<guardian> the point is, ensure you didn't break items you believed you didn't touch, upon a recompile
<guardian> or another reason: make sure diffs in the atom feed are only additions: which you can figure out with a quick glance at a diff
bghost has quit [Ping timeout: 240 seconds]
<Keltia> guardian: enable_output_diff: true is not enough for you?
<guardian> no
<Keltia> bobthecow: am I being too difficult?
<guardian> enable output diff works from one compile to the other
<guardian> but you can have many recompiles between two deploys
<bobthecow> Keltia: just multitasking poorly :)
<bobthecow> i'll respond in a sec.
<Rym> Keltia: did you get it fixed?
<Keltia> Rym: nope
<Rym> if it's still the same error as in that gist, try removing 'for i in' from the start of the erroring line
<Keltia> Rym: I got that but I'm not sure how to give parameters to render()
<darix> Keltia: render 'templatename' :param => value, :param2 => value2
<Rym> well, the error would change and then you send additional locals to the partial e.g. <% render 'listitem', :part => i %>
<darix> and you will have @param and @param2 in the rendered template
<Rym> and in the list item partial
<Rym> yeah what darix said
<Keltia> I'm getting there
<darix> Rym: <%= render 'listitem', :part => i %>
<Rym> thanks, yeah
<Keltia> darix: made some progress but https://gist.github.com/keltia/d9210ef4511ddd365d96
<darix> @item['/about/cameras/']
<darix> that returns nil
<Keltia> darix: but "nanoc show-data" shows that it does exist
<darix> try
<darix> you want to pick the item with identifier? '/about/cameras/'
<Keltia> I want the children of it
<darix> well
<darix> why not just
<darix> @item.children.sort{|i,j| i[:slug] <=> j[:slug] }.each
<Keltia> ok, that works. Now, to fix the layout because I get <p>#<:item:0x007fb15a0658e8></:item:0x007fb15a0658e8></p> which is clearly incorrect :)
<Keltia> \o/ found the correct recipe
<bobthecow> Keltia: "for i in ..." isn't valid ruby.
<bobthecow> that's how you'd do it in python or js...
<bobthecow> but ruby is
<bobthecow> (...).each do |i|
<Keltia> bobthecow: fixed a long time ago :) see above what works
<bobthecow> that's the same as
<bobthecow> for i in (...) in python
<bobthecow> :)
<bobthecow> nice!
<bobthecow> note that you'll have trouble with your sorting.
<bobthecow> since part12 comes before part2
<bobthecow> oh. wait.
<bobthecow> slug.to_i
<Keltia> bobthecow: fixed too
<bobthecow> you can use #sort_by instead of #sort
bghost has joined #nanoc
<bobthecow> @item.children.sort_by { |i| i[:slug].to_i }.each ...
<Keltia> bobthecow: yep, fixed that too now
<bobthecow> the only other thing i'd do is move the compilation of the sub-items into rules rather than an embedded erb file.
jugglinmike has quit [Quit: Leaving.]
<Keltia> bobthecow: I thought about that as well but I don't know yet how to achieve that
<Keltia> I must say I really like nanoc and the way it is designed. Could use more doc though :)
<Keltia> I did the same in radiancms before but it was much more cumbersome with the web interface
jugglinmike has joined #nanoc
<bobthecow> something very much like that.
<Keltia> bobthecow: I was coming to the same conclusion, thanks, lemme try that
bghost has quit [Quit: leaving]
<Keltia> bobthecow: weird, it is as if it was removing the two <div> from listitem.html
jugglinmike has quit [Quit: Leaving.]