diff --git a/src/pages/resources/404.tsx b/src/pages/resources/404.tsx index 607fc9c..aaa6267 100644 --- a/src/pages/resources/404.tsx +++ b/src/pages/resources/404.tsx @@ -57,7 +57,8 @@ function levenshteinDistance(term1: string, term2: string) { return matrix[term2.length][term1.length] } -function getPossibleResources( +function getPossibleCorrections( + basepath: string, location: WindowLocation, data: { allFile: FileConnection } ) { @@ -74,7 +75,7 @@ function getPossibleResources( // location.pathname is link after protocol and hostname // by replacing `"/resources/"`, // we are left with only the relative path to `resources` - const search = location.pathname.replace("/resources/", "") + const search = location.pathname.replace(`/${basepath}/`, "") // filter based on distance // levenshtein distance of x means how 'off' it was @@ -96,7 +97,7 @@ function getPossibleResources( {displayArray.map((value, index) => { return (
You just hit a route that doesn't exist... the sadness.