Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

mv template files.

  • Loading branch information...
commit 38167996b910f5b7d30056afd90d8a8d1604a543 1 parent 531a3b7
Yusuke Wada authored
12 lib/Yomico/Web.pm
View
@@ -65,7 +65,7 @@ sub root_from_path {
sub render_args {
my ( $self, $template, $args ) = @_;
- my $template_content = file( $self->local_or_share_file($template) )->slurp;
+ my $template_content = file( $self->local_or_share_file( ['templates' , $template] ) )->slurp;
my $tx = Text::Xslate->new( syntax => 'TTerse', );
my $html = $tx->render_string( $template_content, $args );
return $html;
@@ -73,8 +73,8 @@ sub render_args {
sub render_content {
my ( $self, $content_html ) = @_;
- my $header = file( $self->local_or_share_file('header.tt') )->slurp;
- my $footer = file( $self->local_or_share_file('footer.tt') )->slurp;
+ my $header = file( $self->local_or_share_file( ['templates','header.tt'] ) )->slurp;
+ my $footer = file( $self->local_or_share_file( ['templates','footer.tt'] ) )->slurp;
my $tx = Text::Xslate->new(
syntax => 'TTerse',
);
@@ -98,10 +98,10 @@ sub return_404 {
}
sub local_or_share_file {
- my ( $self, $name ) = @_;
- my $local_name = File::Spec->catfile('share', $name);
+ my ( $self, $files ) = @_;
+ my $local_name = File::Spec->catfile('share', @$files );
return $local_name if -f $local_name;
- return dist_file( 'Yomico', $name );
+ return dist_file( 'Yomico', join('/', @$files) );
}
sub make_path {
0  share/dir.tt → share/templates/dir.tt
View
File renamed without changes
0  share/footer.tt → share/templates/footer.tt
View
File renamed without changes
0  share/header.tt → share/templates/header.tt
View
File renamed without changes
Please sign in to comment.
Something went wrong with that request. Please try again.