Add total number of subresults per main result

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
This commit is contained in:
Johannes Marbach 2026-03-20 13:37:41 +01:00
parent a56969149f
commit 94fca47a7d

View file

@ -146,15 +146,16 @@ search backend.
} else { } else {
results.forEach((r, index_r) => { results.forEach((r, index_r) => {
// Add the main result's page title. // Add the main result's page title.
$searchResultBody.append( $searchResultBody.append($("<div>")
$("<a>") .append($("<a>")
.addClass("d-block")
.css({ .css({
fontSize: "1.2rem", fontSize: "1.2rem",
}) })
.attr("href", r.url) .attr("href", r.url)
.text(r.meta.title) .text(r.meta.title))
); .append($("<span>")
.addClass("text-body-secondary")
.text(` ${r.sub_results.length} result(s)`)));
// Render the first 3 subresults per page and wrap the rest // Render the first 3 subresults per page and wrap the rest
// in a collapsed container. // in a collapsed container.