From a7244a2983538f373c0af2ecfa4d6377584b8063 Mon Sep 17 00:00:00 2001 From: Hysterelius Date: Sun, 21 Jul 2024 01:33:32 +1000 Subject: Add pagefind search to abridge (#179) * Start process of adding pagefind to abridge * Write to static to make index appear in public * Add multilingual support * Minify files and fix running in script * Add pagefind files * Add loading of pagefind data * Update gitignore to remove pagefind index files * Get basic search result surfacing working * Remove duplicate entries in search results * Sanitise except to remove unnecessary details * Finalise addition of pagefind * Add missing await * Fix config.toml and remove old files on rebuild * Finish chores on pagefind addition--- static/js/search.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'static/js/search.js') diff --git a/static/js/search.js b/static/js/search.js index 30cc278..caf5817 100644 --- a/static/js/search.js +++ b/static/js/search.js @@ -344,10 +344,10 @@ window.onload = function() { // Check the string is ascii characters or not var re = /^[\x00-\xff]+$/ if (word[1] !== TERM_WEIGHT && word[0].length >= 12 && !re.test(word[0])) { - // If the string's length is too long, it maybe a Chinese/Japance/Korean article + // If the string's length is too long, it maybe a Chinese/Japanese/Korean article // if using substring method directly, it may occur error codes on emoji chars - var strBefor = body.substring(word[2], startIndex); - var strAfter = substringByByte(strBefor, 12); + var strBefore = body.substring(word[2], startIndex); + var strAfter = substringByByte(strBefore, 12); teaser.push(strAfter); } else { teaser.push(body.substring(word[2], startIndex)); -- cgit v1.3.1