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 '/...'.
This commit is contained in:
barnold 2022-10-02 12:49:09 +01:00
parent 595b4be156
commit dd6ea0a0ba
2 changed files with 3 additions and 3 deletions

View File

@ -83,7 +83,7 @@ sub startup ($self) {
# Set routes.
my $r = $self->routes;
$r->get('/<page_number:num>')->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/<page_number:num>')
->to('book#authors', page_number => 1)->name('authors');
$r->get('/author/<id:num>/<page_number:num>')->to('book#author')->name('author');

View File

@ -2,7 +2,7 @@
<html>
<head>
<title><%= title %></title>
<link rel="stylesheet" href="/default.css">
%= stylesheet '/default.css'
</head>
<body>
<ul class="top">
@ -20,7 +20,7 @@
</li>
<li>
<a href="/about#search-help">Search help</a>
<a href="<%= url_for('about') . '#search-help' %>">Search help</a>
</li>
<li>