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>
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