From dd6ea0a0ba5966687f07f9120fd1db4aa53a1cea Mon Sep 17 00:00:00 2001 From: barnold Date: Sun, 2 Oct 2022 12:49:09 +0100 Subject: [PATCH] Improve links to be "portable"... so that they still work if the app is server under a 'root' path like '/pg-catalog/...' instead of directly under '/...'. --- lib/MyApp.pm | 2 +- templates/layouts/default.html.ep | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/MyApp.pm b/lib/MyApp.pm index ed3576b..c0461f8 100644 --- a/lib/MyApp.pm +++ b/lib/MyApp.pm @@ -83,7 +83,7 @@ sub startup ($self) { # Set routes. my $r = $self->routes; $r->get('/')->to('book#books', page_number => 1)->name('books'); - $r->get('/about')->to('book#about'); + $r->get('/about')->to('book#about')->name('about'); $r->get('/authors/') ->to('book#authors', page_number => 1)->name('authors'); $r->get('/author//')->to('book#author')->name('author'); diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep index 7da74e7..95bf796 100644 --- a/templates/layouts/default.html.ep +++ b/templates/layouts/default.html.ep @@ -2,7 +2,7 @@ <%= title %> - + %= stylesheet '/default.css'