Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Express and Hogan.js Partials
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  12 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Felix Weiss  
View profile  
 More options Sep 1 2012, 8:52 pm
From: Felix Weiss <felix.we...@gmail.com>
Date: Sat, 1 Sep 2012 17:52:39 -0700 (PDT)
Local: Sat, Sep 1 2012 8:52 pm
Subject: Express and Hogan.js Partials

It' great, we can generate an app with Hogan.js support, because Hogan.js
is really fast an usually partials are possible. So my question: How can we
use partials with Express? Or is this feature still disabled in Express? I
tried to get it working, but somehow it doesn't. :-/

I would appreciate your hint! :-)

layout.hjs

about.hjs


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pablo J. Novas  
View profile  
 More options Sep 22 2012, 12:12 pm
From: "Pablo J. Novas" <pjno...@gmail.com>
Date: Sat, 22 Sep 2012 09:12:18 -0700 (PDT)
Local: Sat, Sep 22 2012 12:12 pm
Subject: Re: Express and Hogan.js Partials

Felix, I have exactly the same problem, I couldn't find any info about it
... so, +1 for that support

What I did find was this npm package (I didn't try it) which adds the
support for partials & layouts, but I think I'm gonna go with Jade for now

https://npmjs.org/package/hogan-express


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pablo J. Novas  
View profile  
 More options Sep 22 2012, 12:35 pm
From: "Pablo J. Novas" <pjno...@gmail.com>
Date: Sat, 22 Sep 2012 09:35:15 -0700 (PDT)
Local: Sat, Sep 22 2012 12:35 pm
Subject: Re: Express and Hogan.js Partials

hey, after researching more ... I found this hehe

https://github.com/visionmedia/express/issues/1093


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Felix Weiss  
View profile  
 More options Sep 26 2012, 1:06 pm
From: Felix Weiss <felix.we...@gmail.com>
Date: Wed, 26 Sep 2012 10:06:45 -0700 (PDT)
Local: Wed, Sep 26 2012 1:06 pm
Subject: Re: Express and Hogan.js Partials

I got this solution:

index.hjs
<html>
  <head>
    <title>{{ title }}</title>
  </head>
  <body>
    <!-- body: res.render -->
  </body>
</html>

about.hjs
<h1>{{ headline }}</h1>
<p>Welcome to {{ name }}</p>

router.js
    app.get('/', function(req, res) {
       res.render('index', {
            title: 'Nested Templates',
            body: res.render('about', {
                headline: 'About Hogan.js in Express',
                name: 'Node.js'
            })
        });
    });

Am Sonntag, 2. September 2012 02:52:39 UTC+2 schrieb Felix Weiss:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Felix Weiss  
View profile  
 More options Sep 26 2012, 1:57 pm
From: Felix Weiss <felix.we...@gmail.com>
Date: Wed, 26 Sep 2012 10:57:00 -0700 (PDT)
Subject: Re: Express and Hogan.js Partials

But I just realized, that all stylesheets will be ignored. :-/

Am Mittwoch, 26. September 2012 19:06:45 UTC+2 schrieb Felix Weiss:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Felix Weiss  
View profile  
 More options Sep 26 2012, 2:02 pm
From: Felix Weiss <felix.we...@gmail.com>
Date: Wed, 26 Sep 2012 11:02:16 -0700 (PDT)
Local: Wed, Sep 26 2012 2:02 pm
Subject: Re: Express and Hogan.js Partials

Another possible solution:

index.hjs
<!DOCTYPE html>
<html>
  <head>
    <title>{{ title }}</title>
  </head>
  <body>
    {{ about }}
  </body>
</html>

router.js
    var about = fs.readFileSync('about.hjs', 'utf-8');

    app.get('/', function(req, res) {
       res.render('index', {
            title: 'Nested Templates',
            about: about
        });
    });

Am Sonntag, 2. September 2012 02:52:39 UTC+2 schrieb Felix Weiss:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Long  
View profile  
 More options Sep 27 2012, 9:41 am
From: James Long <longs...@gmail.com>
Date: Thu, 27 Sep 2012 09:41:10 -0400
Local: Thurs, Sep 27 2012 9:41 am
Subject: Re: [Express-js] Re: Express and Hogan.js Partials
If you keep having a lot of problems with this, it might be worth
checking out a different templating engine. I wrote nunjucks, a port
of jinja2, because I was having these kinds of problems over and over.

http://nunjucks.jlongster.com/

All you have to do is:

{% include "about.html" %}

- James


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
tjholowaychuk  
View profile  
 More options Sep 27 2012, 11:43 am
From: tjholowaychuk <tjholoway...@gmail.com>
Date: Thu, 27 Sep 2012 08:43:49 -0700 (PDT)
Local: Thurs, Sep 27 2012 11:43 am
Subject: Re: Express and Hogan.js Partials
this is just the nature of hogan... most mustaches do not perform any
IO, thus
you can't really use layouts or partials unless you load them in first

On Sep 27, 6:41 am, James Long <longs...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alex Veenendaal  
View profile  
 More options Oct 1 2012, 5:13 am
From: Alex Veenendaal <a...@opendoorgonorth.com>
Date: Mon, 1 Oct 2012 02:13:46 -0700 (PDT)
Local: Mon, Oct 1 2012 5:13 am
Subject: Re: Express and Hogan.js Partials

I ended up overriding some parts of mustache.js to allow partials
integration with express:

https://gist.github.com/3810440

And you include a partial the usual mustache way, but with a relative path
to the actual partial:

{{> relative/path/to/partial }}

Its a little brittle, but it works with caching, and allows you access to
partials directly through app.partial()


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan Hawkes  
View profile  
 More options Oct 13 2012, 3:56 pm
From: Jonathan Hawkes <jonathan.haw...@gmail.com>
Date: Sat, 13 Oct 2012 12:56:09 -0700 (PDT)
Local: Sat, Oct 13 2012 3:56 pm
Subject: Re: Express and Hogan.js Partials

I just released mmm specifically for this problem.  It uses Hogan.js and
brings in support for partials, layout and caching.  It was built
specifically for Express 3.

https://github.com/techhead/mmm


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Louis Chatriot  
View profile  
 More options Nov 22 2012, 6:17 am
From: Louis Chatriot <lo...@tldr.io>
Date: Thu, 22 Nov 2012 03:17:00 -0800 (PST)
Subject: Re: Express and Hogan.js Partials

We just open-sourced our own solution, h4e ("hogan for express"). We use it
to have Express use hogan with support for partials and layouts, and also
to directly render Mustache templates (e.g. for emails we send our users).
As TJ says, there is no two ways around it, all templates are precompiled
and cached (it takes ver little time, ~1ms per template).

I would love to get your feedback on it: https://github.com/tldrio/h4e

Louis

Le samedi 13 octobre 2012 21:56:10 UTC+2, Jonathan Hawkes a écrit :


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erin Noe-Payne  
View profile  
 More options Dec 4 2012, 1:46 pm
From: Erin Noe-Payne <sai...@gmail.com>
Date: Tue, 4 Dec 2012 10:46:28 -0800 (PST)
Local: Tues, Dec 4 2012 1:46 pm
Subject: Re: Express and Hogan.js Partials

I would recommend taking a look at https://github.com/barc/express-hbs

This is using handlebars, another mustache-based implementation; it adds
easy-to-use support for partials, layouts, and blocks, and it exports
itself as an express 3 view engine.

I prefer the simplicity of a mustache type templating engine over jade or
other ejs solutions, and this module extends the basic functionality to
give you a fully featured view engine.

Good luck!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »