Adjustments for subdirectory serving (2)
diff --git a/lib/Kalamar.pm b/lib/Kalamar.pm
index 10d2e53..9e27648 100644
--- a/lib/Kalamar.pm
+++ b/lib/Kalamar.pm
@@ -25,6 +25,7 @@
my $host = $c->req->headers->header('X-Forwarded-Host');
if ($host && $host eq 'korap.ids-mannheim.de') {
$c->req->url->base->path('/kalamar/');
+ $c->stash(prefix => '/kalamar');
};
}) if $self->mode eq 'production';
diff --git a/templates/layouts/main.html.ep b/templates/layouts/main.html.ep
index 6280855..cf7f95e 100644
--- a/templates/layouts/main.html.ep
+++ b/templates/layouts/main.html.ep
@@ -4,8 +4,8 @@
<title><%= title() // loc('korap_desc') %></title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=false, user-scalable=no" />
- <link href="/img/favicon.ico" rel="shortcut icon" type="image/x-icon" />
- <link href="/css/kalamar-<%= $Kalamar::VERSION %>.css" type="text/css" rel="stylesheet" />
+ <link href="<%= stash 'prefix' %>/img/favicon.ico" rel="shortcut icon" type="image/x-icon" />
+ <link href="<%= stash 'prefix' %>/css/kalamar-<%= $Kalamar::VERSION %>.css" type="text/css" rel="stylesheet" />
</head>
% my $embedded = 0;
% $embedded = 1 if stash('embedded');
@@ -34,7 +34,7 @@
</footer>
% };
-%= javascript '/js/' . loc('jsFile', 'kalamar-' . $Kalamar::VERSION . '-en.js')
+%= javascript '<%= stash 'prefix' %>/js/' . loc('jsFile', 'kalamar-' . $Kalamar::VERSION . '-en.js')
%= javascript begin
window.KorAP = window.KorAP || {};
% my $api = url_for('index')->to_abs;