Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Love Yeoman. For the love of god, how do I create 'pretty permalink' (Jekyll Style) with it - "about.html" to create "/about/index.html"?


Nginx - just remap the urls. We run http://carrot.is (not meant to be a plug, just an example) served statically via nginx and the urls are "pretty". You can use a little statement like this in your nginx config:

if ( $uri !~ /index\.html$) { rewrite ^(/.+)\.html$ $scheme://$host$1 permanent; }


Offtopic - your username reminds me of a line from the Beverly HillBillies that went something like: "Hi, I'm Jethro Bodine; initials JB. Turn it around, BJ -- Boy Jenius." Ha ha.


+1 to jenius for a server-side solution but in addition:

Yeoman helps manage and coordinate various build tools, but for pretty permalinks on your production build, you're probably going to need something like a plugin for `grunt build` that renames files as they're copied into your /dist directory.


For development we use grunt-connect-rewrite. It is a middleware for connect (which yeoman uses) that allows you to write custom rules similarly to how you would implement them in Apache.

You can see our connect setup in this gist

https://gist.github.com/TheAlphaNerd/6322927




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: