[Dancer-users] Template engines

Marco Fontani mfontani at cpan.org
Wed Feb 16 21:22:56 CET 2011


> But after several unsuccessful attempts to use it i realized one simple thing:
> Dancer idea of template engine is not compatible with Text::Xslate fundamentally.

Not true. See below.

> Unfortunately I have no good ideas on how to combine Dancer with Text::Xslate
> but I feel that this should be done :)

I use Dancer with Xslate templates for my blog:
https://github.com/mfontani/Brocco

config.yml change needed (a hack really):

engines:
  xslate:
    cache_dir: "/tmp/wherever"
    cache: 1
    path:
      - /
      - ./views

The "path" is the important bit:
- needs / so that the files that are given by full path can work
- needs views/ since the main layout path is given relative to that

Hope you can now enjoy Xslate and Dancer both :)

-marco-

-- 
Marco Fontani
Glasgow Perl Mongers - http://glasgow.pm.org/
Join the RackSpace Cloud at: http://www.rackspacecloud.com/277.html


More information about the Dancer-users mailing list