Hacker News new | ask | show | jobs
by salman89 4473 days ago
What he's saying is that the views you want to be SEO'd can be generated server side and bootstrapped into Backbone (hook backbone views into an element that is rendered server side).

I currently do this too - I'll add that it is helpful to use a templating language that will work both server side and client side so you only write your templates once.

What does become a pain is doing routers/controllers both client side and server side - end up writing some code more than once and in different languages. Harder to maintain, especially when changes are made.

1 comments

Right, and if you want to generate them server side, you either need to have separate templates for server side and client side, or you can execute the javascript on the server (which is what the OP decided to do).

Noone is saying there aren't other solutions to the problem, but I think the OP's solution met his goals pretty well and I thought it was a neat concept.

> you either need to have separate templates for server side and client side

there exists templating engines that run on both server and client - for example, google closure templates.

You can use cross-language templating options - personally I use mustache.

No disagreements on multiple solutions - definitely a cool approach.