From 7a3946ef122e8218c6ce3355d7f968562212d53b Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 18 Apr 2019 08:25:56 +0000 Subject: www: support listing of inboxes We will still return a 404 by default to '/' for compatibility with users of Plack::App::Cascade or similar. Inboxes are sorted by modification times to help users detect activity (similar to the /$INBOX/ topic view). New configuration options: * publicinbox.wwwlisting - configure the listing type * publicinbox..hide - hide a particular inbox from the listing See changes to public-inbox-config.pod for full descriptions of the new options. Requested-by: Leah Neukirchen https://public-inbox.org/meta/871sdfzy80.fsf@gmail.com/ --- lib/PublicInbox/WwwStream.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/PublicInbox/WwwStream.pm') diff --git a/lib/PublicInbox/WwwStream.pm b/lib/PublicInbox/WwwStream.pm index 8b79923b..c708c21f 100644 --- a/lib/PublicInbox/WwwStream.pm +++ b/lib/PublicInbox/WwwStream.pm @@ -71,6 +71,12 @@ sub _html_top ($) { "". $top . $tip; } +sub code_footer ($) { + my ($env) = @_; + my $u = PublicInbox::Hval::prurl($env, $CODE_URL); + qq(AGPL code for this site: git clone $u $PROJECT) +} + sub _html_end { my ($self) = @_; my $urls = 'Archives are clonable:'; @@ -139,12 +145,10 @@ EOF $urls .= qq[$TOR2WEB_URL]; } } - my $url = PublicInbox::Hval::prurl($ctx->{env}, $CODE_URL); '
'.join("\n\n",
 		$desc,
 		$urls,
-		'AGPL code for this site: '.
-		qq(git clone $url $PROJECT)
+		code_footer($ctx->{env})
 	).'
'; } -- cgit v1.2.3-24-ge0c7