diff options
Diffstat (limited to 'lib/PublicInbox/Config.pm')
-rw-r--r-- | lib/PublicInbox/Config.pm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm index 9f1e57ac..2c1c5111 100644 --- a/lib/PublicInbox/Config.pm +++ b/lib/PublicInbox/Config.pm @@ -234,6 +234,12 @@ sub scan_path_coderepo { sub parse_cgitrc { my ($self, $cgitrc, $nesting) = @_; + if ($nesting == 0) { + # defaults: + my %s = map { $_ => 1 } qw(/cgit.css /cgit.png + /favicon.ico /robots.txt); + $self->{-cgit_static} = \%s; + } # same limit as cgit/configfile.c::parse_configfile return if $nesting > 8; @@ -263,6 +269,10 @@ sub parse_cgitrc { $self->{-cgit_scan_hidden_path} = $1; } elsif (m!\Ascan-path=(.+)\z!) { scan_path_coderepo($self, '', $1); + + } elsif (m!\A(?:css|favicon|logo|repo\.logo)=(/.+)\z!) { + # absolute paths for static files via PublicInbox::Cgit + $self->{-cgit_static}->{$1} = 1; } } cgit_repo_merge($self, $repo) if $repo; |