about summary refs log tree commit homepage
path: root/lib/PublicInbox/WWW.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-09-05 02:52:47 +0000
committerEric Wong <e@80x24.org>2015-09-05 03:02:35 +0000
commit1e7fe3de7021427f8326a5f7710347035f7a63c5 (patch)
treea536b46fafda4b1347b5907bf1dd795bfd37d76d /lib/PublicInbox/WWW.pm
parent68d0ef45113ad2761e4f065250f329a5f52eb5f0 (diff)
downloadpublic-inbox-1e7fe3de7021427f8326a5f7710347035f7a63c5.tar.gz
This hopefully makes it easier to find things without resorting
to proprietary external services.
Diffstat (limited to 'lib/PublicInbox/WWW.pm')
-rw-r--r--lib/PublicInbox/WWW.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/PublicInbox/WWW.pm b/lib/PublicInbox/WWW.pm
index 5584e49b..2718854c 100644
--- a/lib/PublicInbox/WWW.pm
+++ b/lib/PublicInbox/WWW.pm
@@ -67,6 +67,7 @@ sub preload {
 
         eval {
                 require PublicInbox::Search;
+                require PublicInbox::SearchView;
                 require PublicInbox::Mbox;
                 require IO::Compress::Gzip;
         };
@@ -128,8 +129,14 @@ sub get_index {
         my ($ctx) = @_;
         require PublicInbox::Feed;
         my $srch = searcher($ctx);
+        my $q = $ctx->{cgi}->param('q');
         footer($ctx);
-        PublicInbox::Feed::generate_html_index($ctx);
+        if (defined $q) {
+                require PublicInbox::SearchView;
+                PublicInbox::SearchView::sres_top_html($ctx, $q);
+        } else {
+                PublicInbox::Feed::generate_html_index($ctx);
+        }
 }
 
 # just returns a string ref for the blob in the current ctx