commit - 469be48e163a66d38ef3e063007b3ca90d552606
commit + 789a106aad27ab1178f8b2420738e39aae6bdf10
blob - feb031a358a861abdd888ae5b25bd3c1417004b8
blob + 9289bc39e41cda915f55fe1ec281b329cfc60a2c
--- GotMArc.pm
+++ GotMArc.pm
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(san urlencode parse initpage endpage index_header
- thread_header threntry thrslice thrnav);
+ search thread_header threntry thrslice thrnav);
sub san {
my $str = shift;
my $hdr = readall "$templates/head.html";
my $foot = readall "$templates/foot.html";
my $idxhdr = readall "$templates/index-header.html";
+my $search = readall "$templates/search.html";
sub initpage {
my ($fh, $title) = @_;
print $fh $html;
}
+sub search {
+ my $fh = shift;
+ my $html = $search =~ s/QUERY//r;
+ print $fh $html;
+}
+
sub thread_header {
my ($fh, $e, $mail, $p, $n) = @_;
blob - cff6fe0167118e0c7d107285b0fa797efc285ad9
blob + ff5cece36c866d7184bec2d2bf88229d45621408
--- gotmarc.1
+++ gotmarc.1
with the date range.
.It Pa /etc/gotmarc/logo-small.html
Small version of the logo, included in the thread header.
+.It Pa /etc/gotmarc/search.html
+Template for the search form.
+.Ev QUERY
+is replaced with the search query.
.It Pa /var/www/gotmarc
Default output directory.
.It Pa ~/.cache/gotmarc
blob - d659ee67cdec71fd62bf3467e94662909d08c354
blob + 7fa6de77fdc0b86eb068b53484f86eb3e4b5a73b
--- mkindex
+++ mkindex
use lib ".";
use GotMArc qw(parse san urlencode initpage endpage index_header
- thread_header threntry);
+ search thread_header threntry);
my $outdir = $ENV{'OUTDIR'};
die 'Set $OUTDIR' unless defined $outdir;
say $pfh "</nav>";
}
-sub search {
- my $pfh = shift;
-
- say $pfh <<'EOF' ;
-<form method="get" action="/search">
- <label>Search: <input type="search" name="q" /></label>
- <button type="submit">search</button>
-</form>
-EOF
-}
-
sub copyfrom {
my ($path, $fh) = @_;
blob - /dev/null
blob + 6da5e45d9aa4b148c0944889014bdf4aa3f0e707 (mode 644)
--- /dev/null
+++ templates/search.html
+<form method="get" action="/search">
+ <label>Search: <input type="search" name="q" value="QUERY" /></label>
+ <button type="submit">search</button>
+</form>