about summary refs log tree commit homepage
path: root/lib/PublicInbox/WwwStream.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-09-27 10:48:25 +0000
committerEric Wong <e@80x24.org>2019-09-27 10:50:01 +0000
commit2052e92ba1f75efca6935558ea01898d01751f40 (patch)
tree69e38274109f7d297e59a663135c5912d8c6c49a /lib/PublicInbox/WwwStream.pm
parenta74dcf96dc6113e27762ef5debdc8ec4e2db2296 (diff)
downloadpublic-inbox-2052e92ba1f75efca6935558ea01898d01751f40.tar.gz
This returns a git-config(1)-compatible file to make it easier
to get started on mirroring an existing public-inbox.  Omitting
the "raw" from the URL works, as well, but I'm not sure if
it's very useful.
Diffstat (limited to 'lib/PublicInbox/WwwStream.pm')
-rw-r--r--lib/PublicInbox/WwwStream.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/PublicInbox/WwwStream.pm b/lib/PublicInbox/WwwStream.pm
index e0823c8d..7399b0ad 100644
--- a/lib/PublicInbox/WwwStream.pm
+++ b/lib/PublicInbox/WwwStream.pm
@@ -127,10 +127,15 @@ sub _html_end {
                 $addrs
         public-inbox-index $dir
 EOF
+        } else { # v1
+                $urls .= "\n";
         }
+
+        my $cfg_link = ($ctx->{-upfx} // '').'_/text/config/raw';
+        $urls .= qq(\nExample <a\nhref="$cfg_link">config snippet</a> for mirrors\n);
         my @nntp = map { qq(<a\nhref="$_">$_</a>) } @{$ibx->nntp_url};
         if (@nntp) {
-                $urls .= "\n\n";
+                $urls .= "\n";
                 $urls .= @nntp == 1 ? 'Newsgroup' : 'Newsgroups are';
                 $urls .= ' available over NNTP:';
                 $urls .= "\n\t" . join("\n\t", @nntp) . "\n";