]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/WwwStream.pm
www_stream: fix stupid typo :x
[public-inbox.git] / lib / PublicInbox / WwwStream.pm
index d2bf318bed49a6027e68f7a696a91de1ff29de61..fdab4da3bab2dabf7e71005afe860963177e363e 100644 (file)
@@ -7,13 +7,19 @@ use strict;
 use warnings;
 use PublicInbox::Hval qw(ascii_html);
 use URI;
-use constant PI_URL => 'https://public-inbox.org/README.html';
+use constant PI_URL => 'https://public-inbox.org/';
 
 sub new {
        my ($class, $ctx, $cb) = @_;
        bless { nr => 0, cb => $cb, ctx => $ctx }, $class;
 }
 
+sub response {
+       my ($class, $ctx, $code, $cb) = @_;
+       [ $code, [ 'Content-Type', 'text/html; charset=UTF-8' ],
+         $class->new($ctx, $cb) ]
+}
+
 sub _html_top ($) {
        my ($self) = @_;
        my $ctx = $self->{ctx};
@@ -33,7 +39,8 @@ sub _html_top ($) {
                }
                # XXX gross, for SearchView.pm
                my $extra = $ctx->{-extra_form_html} || '';
-               $top = qq{<form\naction="$upfx"><pre>$top} .
+               my $action = $upfx eq '' ? './' : $upfx;
+               $top = qq{<form\naction="$action"><pre>$top} .
                          qq{ <input\nname=q\ntype=text$q_val/>} .
                          $extra .
                          qq{<input\ntype=submit\nvalue=search />} .
@@ -79,8 +86,8 @@ sub _html_end {
        '<pre>'.join("\n",
                '- ' . $desc,
                $urls,
-               'served with software from public-inbox: '
-                       ."<a\nhref=\"$url\">$url</a>",
+               'Archived served using code from public-inbox:',
+               qq(\tgit clone <a\nhref="$url">$url</a> public-inbox),
        ).'</pre></body></html>';
 }