Skip to content

Commit

Permalink
revert fix 404
Browse files Browse the repository at this point in the history
  • Loading branch information
wangliang181230 committed Jan 3, 2023
1 parent b1df79d commit f41ee5a
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/plugins/search/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,6 @@ export function genIndex(path, content = '', router, depth) {
slug = router.toURL(path, { id: slugify(escapeHtml(text)) });
}

// fix 404
let pathname = location.pathname;
let flag = false;
while (slug.startsWith('#/../') && pathname.lastIndexOf('/') > 1) {
flag = true;
if (pathname.endsWith('/')) {
pathname = pathname.substring(0, pathname.length - 1);
}
pathname = pathname.substring(0, pathname.lastIndexOf('/'));

slug = '#/' + slug.substring(5);
}
slug = pathname + (flag ? '/' : '') + slug;

if (str) {
title = removeDocsifyIgnoreTag(str);
}
Expand Down

0 comments on commit f41ee5a

Please sign in to comment.