summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--lib/Dancer/Template/Xslate.pm5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Dancer/Template/Xslate.pm b/lib/Dancer/Template/Xslate.pm
index a5e21c1..c18aec2 100644
--- a/lib/Dancer/Template/Xslate.pm
+++ b/lib/Dancer/Template/Xslate.pm
@@ -6,7 +6,7 @@ use warnings;
 
 use Carp;
 use Dancer::App;
-use File::Spec::Functions qw(splitpath);
+use File::Spec::Functions qw(abs2rel rel2abs);
 use Text::Xslate;
 
 use base 'Dancer::Template::Abstract';
@@ -43,8 +43,7 @@ sub init {
 sub render {
     my ($self, $template, $tokens) = @_;
     my $app    = Dancer::App->current;
-    my $views_dir = $app->setting('views');
-    (undef, undef, $template) = splitpath $template if $views_dir;
+    $template = abs2rel( rel2abs($template), $app->setting('views') );
     my $xslate = $self->{driver};
     my $content = $xslate->render($template, $tokens);