diff --git a/src/components/404LinkCorrection/index.tsx b/src/components/404LinkCorrection/index.tsx index f54a637..2d00eb0 100644 --- a/src/components/404LinkCorrection/index.tsx +++ b/src/components/404LinkCorrection/index.tsx @@ -74,7 +74,7 @@ export const getPossibleCorrections = ( // 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(`/${basepath}/`, "") + const search = location.pathname.replace(`/${basepath}`, "") // filter based on distance // levenshtein distance of x means how 'off' it was @@ -96,7 +96,7 @@ export const getPossibleCorrections = ( {displayArray.map((value, index) => { return (
  • - + {value.node.relativePath}
  • diff --git a/src/pages/resources/404.tsx b/src/pages/resources/404.tsx index ebb1cd0..c1267af 100644 --- a/src/pages/resources/404.tsx +++ b/src/pages/resources/404.tsx @@ -13,7 +13,9 @@ export default ({ data }: ComponentQuery<{ allFile: FileConnection }>) => (

    RESOURCE NOT FOUND

    You just hit a route that doesn't exist... the sadness.

    - {({ location }) => getPossibleCorrections("resources", location, data, 8)} + {({ location }) => + getPossibleCorrections("resources/", location, data, 8) + } )