express-hogan.js icon indicating copy to clipboard operation
express-hogan.js copied to clipboard

need docs about how to use partials

Open yangchenyun opened this issue 12 years ago • 5 comments

I have my index.mustache including a partial tag {{> form}} and the partial is put under the same path.

However, the partial doesn't load at all.

There is not enough doc in the testapp.js to indicate correct usage of partials, would you help in this case?

I use the following code to render the template:

app.get('/', function (req, res) {
  res.render('home');
})

yangchenyun avatar Jul 09 '12 15:07 yangchenyun

Try to look at testapp-partials.js

dundee avatar Jul 14 '12 14:07 dundee

Hi Dundee, does wrapping the routes with expressHogan.preparePartials the only way to activate partials support?

yangchenyun avatar Jul 16 '12 02:07 yangchenyun

Hi, I am afraid it is right now. You need to parse them in advance.

dundee avatar Jul 17 '12 08:07 dundee

I see. Are you still using in production? I found it is hard to keep the code clean with it.

杨晨昀 Steven Yang / Designer and Web Developer blog.yangchenyun.com

On Tuesday, July 17, 2012 at 4:26 PM, Daniel Milde wrote:

Hi, I am afraid it is right now. You need to parse them in advance.


Reply to this email directly or view it on GitHub: https://github.com/Dundee/express-hogan.js/issues/8#issuecomment-7029401

yangchenyun avatar Jul 17 '12 11:07 yangchenyun

You can decompose the routes setup to separate function or so to clean it up a bit.

dundee avatar Jul 18 '12 17:07 dundee