quangv / hulk-hogan

Hogan.js for Express with support for Template Partials.
MIT License
37 stars 2 forks source link

relative path should resolve to current template when finding partials #13

Open yangchenyun opened 12 years ago

yangchenyun commented 12 years ago

I have the following file structure

/apps
  /admin
    /views
      index.hulk
      partial.hulk

/views
  layout.hulk

layout.hulk contains

{{{body}}}

index.hulk contains

{{> partial}}

When index.mustache is rendered by express, it fails to load the partial.hulk. However, when I put it under /views, it works.

I think the relative path when finding partials should be resolved to current template when finding partials.

quangv commented 12 years ago

Hey yangchenyun,

Thanks for trying out hulk-hogan.

Yeah you might be correct that the paths are only relative to what you set your views folder to be.

It might be better, like you said, for it to be relative to the actual file itself.

yangchenyun commented 12 years ago

Hi Van, Thanks for this elegant work. This is the most reasonable hogan adapter I found. I will try to read this code and tweak it later.

Best,

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

On Wednesday, July 18, 2012 at 11:04 PM, Quang Van wrote:

Hey yangchenyun,

Thanks for trying out hulk-hogan.

Yeah you might be correct that the paths are only relative to what you set your views folder to be.

It might be better, like you said, for it to be relative to the actual file itself.


Reply to this email directly or view it on GitHub: https://github.com/quangv/hulk-hogan/issues/13#issuecomment-7071443

quangv commented 12 years ago

Hey Yangchenyun,

Thanks I'll leave the issue open for now...

-q

yangchenyun commented 12 years ago

Thanks for that, will close this when I finished.

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

On Wednesday, July 25, 2012 at 2:51 AM, Quang Van wrote:

Hey Yangchenyun,

Thanks I'll leave the issue open for now...

-q


Reply to this email directly or view it on GitHub: https://github.com/quangv/hulk-hogan/issues/13#issuecomment-7228581

quangv commented 12 years ago

Is this similar to #6 ?

yangchenyun commented 12 years ago

Exactly.