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
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
VitamineD has quit [Quit: VitamineD]
summatusmentis has joined #nanoc
<summatusmentis> is there a way to cause a redirect when an item is hit?
<summatusmentis> (requested)
<alerante> nanoc doesn't have any special machinery for that
<summatusmentis> ok, thanks
<alerante> you'd either have to configure whatever server is serving the nanoc files (e.g. .htaccess) or use <meta> refresh
<bobthecow> summatusmentis: that's something you should set up with your webserver.
<bobthecow> yeah, what alerante said.
<summatusmentis> right, ok
<summatusmentis> was hopting to get around fighting with the routing rules by doing it differently :)
<bobthecow> you shouldn't need to.
<bobthecow> what are you currently trying to get around?
<bobthecow> is this tom?
<summatusmentis> I have a blog setup at content/ephemera/
<summatusmentis> and I don't currently have any content for /
<summatusmentis> so I'd like to have the root URL point to /ephemera/
<summatusmentis> my name is Jake
<summatusmentis> so, no
<summatusmentis> we were conversing earlier about routing rules
<bobthecow> oh, sorry, a guy named tom on the mailing list has been fighting with rules and i thought you might be him :)
<summatusmentis> nope, I drastically prefer IRC to mailing lists :)
<bobthecow> is your entire website under /ephemera/ ?
<summatusmentis> no
<summatusmentis> I've also got some top-level items
<bobthecow> so you're just looking to redirect from / to /ephemera/... no other redirects?
<summatusmentis> well, and I'd like the /epehemera/feed/ rule to stay intact
<summatusmentis> but no, that's the only redirect I want
<bobthecow> that's a one-line setting in your server, then.
<bobthecow> what server are you using?
<summatusmentis> nginx, I can look up the redirection stuff
<summatusmentis> your point is, nanoc won't do that for me?
<bobthecow> nanoc makes static files.
<bobthecow> html files.
<summatusmentis> I understand that, I guess I was assuming I could get / to "point" to /ephemera
<bobthecow> you could make an empty html file with a <meta> redirect, but that's a bit of a ghetto way of redirecting.
<summatusmentis> yeah, I'll just do the nginx equivalent of an .htaccess
<bobthecow> nanoc *can't* tell your webserver to "point" to something else. when you request a URL, your webserver has 100% of the control over what it serves.
<bobthecow> nanoc can only generate the files that your webserver will serve.
<summatusmentis> right, now that you say it that way it makes sense
<summatusmentis> it's just so magical, I wanted it to do more :)
<bobthecow> :)
<bobthecow> i have it generate redirects for me based on an alias property in the item metadata. that's pretty magical.
<bobthecow> for example -> http://justinhileman.info/git-pretty/
<bobthecow> that article has "alias: git-pretty" in the frontmatter.
<bobthecow> there are approximately 850 other aliases in my site.
<bobthecow> every time i compile it spits out a map of them so my server will redirect to the canonical url.
<summatusmentis> that's super convenient
<bobthecow> i migrated my blog from typepad or something to drupal years ago...
<bobthecow> then from drupal to nanoc fewer years ago.
<bobthecow> so i have three sets of urls for a lot of my content :)
<bobthecow> and they all still work, despite it being a static site now.
<summatusmentis> I've had enough requirements of server moving (with the same URL), and it's an entirely personal blog, that I finally decided to get rid of wordpress
alerante has quit [Remote host closed the connection]
<guardian> morning
<bobthecow> guardian: nope nope.
<bobthecow> it's 11:24 pm. you couldn't be much more wrong.
<guardian> its 8am
<guardian> it's
<guardian> :)
<guardian> bobthecow: did you read those three lines I addressed you before going to bed yesterday? :) seeking for consensus here.
<bobthecow> yeah. if i were you i'd throw it in the metadata.
<bobthecow> seems like the most straightforward way to handle it.
<guardian> about an easy way for thec writer going to use my nanoc based documentation framework to have an item provide side-nav data
<guardian> it's straightforward enough, and it separates logic from layouting/rendering
<bobthecow> that way it's explicit, and it's in the context of the item.
<bobthecow> that's the important part.
<guardian> now, you're patient with that tom guy on the list :) that's nice of you!
<guardian> and finally about aliases, are you generating .htaccess from items metadata (or nginx rules) and then have the webserver do the redirect?
<bobthecow> yeah.
<guardian> or are you duplicating the items? (which I guess would be something hurting SEO right?)
<guardian> I've seen sites doing the later
<bobthecow> i'm serving my site with nginx, so i can't use .htaccess.
<bobthecow> i'm actually generating a php file :P
<bobthecow> i figured it was cheaper to keep 800+ rewrite rules out of the config for normal requests, and just fall back to checking them in case of a 404.
<bobthecow> it actually made a difference in the request processing time.
<guardian> with a VPS setup, you could even generate some nginx conf fragment you include. And ask nginx to reload its config upon deploy
<bobthecow> yeah. i did that.
<bobthecow> but it's faster not to.
<guardian> ok
<bobthecow> instead i generate a php file that's basically a giant array lookup.
<bobthecow> it's my "404 page"
<bobthecow> i'd rather slow down alias lookups than slow down every page load :)
<guardian> indeed, I'm writing down this trick :)
<guardian> so this new nanoc product doc site thingy I'm working on is based on Zurb Foundation
<guardian> I'm unimpressed so far
<bobthecow> more or less impressed than bootstrap?
<guardian> I went for Foundation because it's supposedly well tested and others could jump in more easily than into my own sass... but it totally feel like I don't have enough control
<guardian> never tried bootstrap, but I'm not a fan of having to stick css classes and divs to describes rows and columns for example
<bobthecow> yeah. me neither.
<guardian> also, maybe I took my vertical rhythm homework to the letter but on my personal site, at least even with images with different aspect ratio I achieved perfect grid alignment
<guardian> e.g. http://s7.postimg.org/e33g6spuz/vertical_rythm_1.png and http://s13.postimg.org/huggooxs7/vertical_rythm_2.png (ok at the end of the page, there are still off by 1 errors due to percentage rounding)
<guardian> but the layout is all fluid and vertical rhythm is maintained even with different aspect ratio images
<guardian> I tried to display a baseline grid on this foundation template I replicated http://foundation.zurb.com/templates/sidebar.html
<guardian> but it's already off due to the top left 400x100 logo put in an <img>
<guardian> and when you resize the browser window down, layout jumps in steps and at certain sizes it just weirdly has horizontal scroll
<guardian> so, unimpressed by the stock examples supposed to show off how well put this framework is
relix has joined #nanoc
alerante has joined #nanoc
alerante has quit [Ping timeout: 252 seconds]
<guardian> ddfreyne: in my route '*' rule, I'm doing item.identifier == '/' ? '/index.html' : path.chop! + '.html'
<guardian> ddfreyne: this creates output/index.html, so far so good
<guardian> ddfreyne: however, when I debug using pry, I get
<guardian> [1] pry(#<Nanoc::Context>)> @items['/'].path
<guardian> => "/"
<guardian> ddfreyne: I'm surprised it doesn't return "/index.html", any idea?
<guardian> alright, I found out about index_filenams while debugging nanoc itself :) pry is great
antognol` is now known as antognolli
alerante has joined #nanoc
alerante has quit [Ping timeout: 272 seconds]
VitamineD has joined #nanoc
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pavelkunc has joined #nanoc
alerante has joined #nanoc
alerante has quit [Ping timeout: 248 seconds]
alerante has joined #nanoc
alerante has quit [Ping timeout: 252 seconds]
gnufied has quit [Ping timeout: 252 seconds]
VitamineD has quit [Quit: VitamineD]
VitamineD has joined #nanoc
VitamineD has quit [Quit: VitamineD]
relix has joined #nanoc
alerante has joined #nanoc
VitamineD has joined #nanoc
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
relix has joined #nanoc
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
relix has joined #nanoc
relix has quit [Client Quit]
relix has joined #nanoc
VitamineD has quit [Ping timeout: 245 seconds]
VitamineD has joined #nanoc
summatusmentis has left #nanoc [#nanoc]
alerante has quit [Remote host closed the connection]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
VitamineD has quit [Quit: VitamineD]
VitamineD has joined #nanoc
<ddfreyne> guardian: what is `path`?
<ddfreyne> guardian: Also, don't use #chop! but #chop (don't modify data)
alerante has joined #nanoc
<guardian> ah it's chop because it acts on a copy
<guardian> and my pb was related to index_filenames
<guardian> I totally overlooked nanoc strips that from paths
pavelkunc has quit [Quit: Leaving.]
clusterfoo has joined #nanoc
clusterfoo has left #nanoc ["Leaving"]