From: Dan Brown Date: Sun, 28 Jan 2024 17:16:55 +0000 (+0000) Subject: Tweaked webidx search indexing further X-Git-Url: http://source.bookstackapp.com/website/commitdiff_plain/480c6925fbb2d5c2fd0d42035a6d5ccf753cd962 Tweaked webidx search indexing further --- diff --git a/content/docs/admin/_index.md b/content/docs/admin/_index.md index 79008fe..38e822b 100644 --- a/content/docs/admin/_index.md +++ b/content/docs/admin/_index.md @@ -1,4 +1,4 @@ --- -title: "BookStack Blog" +title: "Admin Documentation" type: "admin-doc" --- \ No newline at end of file diff --git a/content/docs/user/_index.md b/content/docs/user/_index.md index 3c7c302..7f131ae 100644 --- a/content/docs/user/_index.md +++ b/content/docs/user/_index.md @@ -1,4 +1,4 @@ --- -title: "BookStack Blog" +title: "User Documentation" type: "user-doc" --- \ No newline at end of file diff --git a/search/webidx.pl b/search/webidx.pl index ae4c86e..3bacf25 100644 --- a/search/webidx.pl +++ b/search/webidx.pl @@ -56,7 +56,7 @@ my $db = DBI->connect('dbi:SQLite:dbname='.$dbfile, '', '', { # # a list of words we want to exclude # -my @common = qw(be and of a in to it i for he on do at but from that not by or as can who get if my as up so me the are we was is); +my @common = qw(be and of a in to it i for he on do at but from that not by or as can who get if my as up so me the are we was is you this with an when want our there has); # # this is a map of filename => page title @@ -229,16 +229,18 @@ sub index_html { # start tag handler # 'start_h' => [sub { - # - # add the alt attributes of images, and any title attributes found - # - $text .= " ".$_[1]->{'alt'} if (lc('img') eq $_[0]); - $text .= " ".$_[1]->{'title'} if (defined($_[1]->{'title'})); - $currtag = $_[0]; if ('main' eq $currtag) { $inmain = 1; } + + if ($inmain) { + # + # add the alt attributes of images, and any title attributes found + # + $text .= " ".$_[1]->{'alt'} if (lc('img') eq $_[0]); + $text .= " ".$_[1]->{'title'} if (defined($_[1]->{'title'})); + } }, qq{tag,attr}], #