Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 47abd0d431
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (18 sloc) 0.545 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{^/}{};
my $is_dir = -d "src/$url" ? 1 : 0;
$url = catfile "/src", $url;
my ( $volume, $directories, $filepart ) = splitpath($template);
my $uri = abs2rel( $url, $directories );
$uri .= '/' if $is_dir;
# 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.