|
@@ -123,6 +123,7 @@ C<nocache>, C<noindex>, C<nomap>, C<robot_name> and C<totp_exempt> become
|
|
|
x-tcms-auth and so on, which the callback finds in C<< $query->{dispatcher} >>.
|
|
x-tcms-auth and so on, which the callback finds in C<< $query->{dispatcher} >>.
|
|
|
C<parameters> are OpenAPI parameter objects, and each variable of a template
|
|
C<parameters> are OpenAPI parameter objects, and each variable of a template
|
|
|
that they leave out is a required string. A route with no method is a GET.
|
|
that they leave out is a required string. A route with no method is a GET.
|
|
|
|
|
+Every route links the scripts of @Theme::scripts before its own C<scripts>.
|
|
|
|
|
|
|
|
A route that does not declare its parameters takes the query or the form that
|
|
A route that does not declare its parameters takes the query or the form that
|
|
|
%Trog::Routes::HTML::inputs names for its callback, less what its C<data> fixes and
|
|
%Trog::Routes::HTML::inputs names for its callback, less what its C<data> fixes and
|
|
@@ -148,6 +149,13 @@ sub build_routes {
|
|
|
my $data = Trog::Data->new($conf);
|
|
my $data = Trog::Data->new($conf);
|
|
|
my %routes = %{ _routes($data) };
|
|
my %routes = %{ _routes($data) };
|
|
|
|
|
|
|
|
|
|
+ # The theme's scripts go on every page, before the page's own. A copy of
|
|
|
|
|
+ # each route, since a route and its /secure copy share one hash.
|
|
|
|
|
+ my @theme_scripts = do { no warnings 'once'; @Theme::scripts };
|
|
|
|
|
+ if (@theme_scripts) {
|
|
|
|
|
+ $routes{$_} = { %{ $routes{$_} }, scripts => [ @theme_scripts, @{ $routes{$_}{scripts} // [] } ] } for keys(%routes);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
my $default_route = $routes{default}{callback};
|
|
my $default_route = $routes{default}{callback};
|
|
|
|
|
|
|
|
my %paths;
|
|
my %paths;
|