feat(404): allow for suffix of matching to be passed in to make archive matches more accurate

This commit is contained in:
Khinshan Khan
2020-01-26 12:30:33 -05:00
committed by Jean-Philippe Sirois
parent 56df4abeb6
commit a796facdb1
2 changed files with 5 additions and 3 deletions
+2 -2
View File
@@ -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 (
<li key={index}>
<Link to={`${basepath}/${value.node.relativePath}`}>
<Link to={`${basepath}${value.node.relativePath}`}>
{value.node.relativePath}
</Link>
</li>