Skip to content

Commit b0ea60c

Browse files
committed
Deploying to gh-pages from @ ae8fb49 🚀
1 parent 29ccda2 commit b0ea60c

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 796b86c2d1ca34872f8045bd78ec5d8e
3+
config: e31fa0e4fc4bc8d7bdd9f7e8704312f6
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

_static/searchtools.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ const Search = {
178178

179179
htmlToText: (htmlString, anchor) => {
180180
const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html');
181-
for (const removalQuery of [".headerlinks", "script", "style"]) {
181+
for (const removalQuery of [".headerlink", "script", "style"]) {
182182
htmlElement.querySelectorAll(removalQuery).forEach((el) => { el.remove() });
183183
}
184184
if (anchor) {
@@ -328,13 +328,14 @@ const Search = {
328328
for (const [title, foundTitles] of Object.entries(allTitles)) {
329329
if (title.toLowerCase().trim().includes(queryLower) && (queryLower.length >= title.length/2)) {
330330
for (const [file, id] of foundTitles) {
331-
let score = Math.round(100 * queryLower.length / title.length)
331+
const score = Math.round(Scorer.title * queryLower.length / title.length);
332+
const boost = titles[file] === title ? 1 : 0; // add a boost for document titles
332333
normalResults.push([
333334
docNames[file],
334335
titles[file] !== title ? `${titles[file]} > ${title}` : title,
335336
id !== null ? "#" + id : "",
336337
null,
337-
score,
338+
score + boost,
338339
filenames[file],
339340
]);
340341
}

0 commit comments

Comments
 (0)