Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 6e01bb2f07
Fetching contributors…

Cannot retrieve contributors at this time

20 lines (17 sloc) 0.499 kb
[% PERL %]
use File::Spec::Functions qw(abs2rel catfile splitpath);
my $template = '/' . $stash->get('template.name');
my $url = $stash->get('url');
if ($url !~ /http/) {
$url =~ s{^/}{};
$url = catfile "/src", $url;
$url .= 'index.html' if $url =~ m|/$|;
my($volume, $directories, $filepart) = splitpath($template);
my $uri = abs2rel($url, $directories);
# warn "$template -> $url = $uri\n";
print $uri;
} else {
# warn "$template -> $url = $url (URL)\n";
print $url;
}
[% END %]
Jump to Line
Something went wrong with that request. Please try again.