Skip to content

Commit

Permalink
Update dreprecated Mojo methods to current methods
Browse files Browse the repository at this point in the history
  • Loading branch information
William H. Gilmore authored and briandfoy committed May 28, 2023
1 parent 3c49795 commit d28e8a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/markdown_viewer
Expand Up @@ -6,11 +6,11 @@ use Encode qw/encode_utf8 decode_utf8/;
plugin 'DirectoryServer', {
auto_index => 0, # disabled directory index
dir_index => 'index.md',
root => app->home->rel_dir('documents'),
root => app->home->rel_file('documents'),
handler => sub {
my ( $c, $path ) = @_;
return unless $path =~ /\.(md|mkdn)$/;
my $markdown = Mojo::Util::slurp($path);
my $markdown = Mojo::File::slurp($path);
my $html = markdown( decode_utf8 $markdown );
$c->render( template => 'markdown', html => $html );
},
Expand Down

0 comments on commit d28e8a7

Please sign in to comment.