Skip to content

Commit

Permalink
Add patch for docusaurus-plugin-search-local
Browse files Browse the repository at this point in the history
  • Loading branch information
bbhtt committed Jul 10, 2024
1 parent f0485e7 commit f816ca8
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/lib/client/theme/SearchModal/SearchResult.jsx b/lib/client/theme/SearchModal/SearchResult.jsx
index bfe22994cc739b48498deedd30ab36957cf566ae..ea26dbf4a6cd8984cdd42f6eb6243faef5be33c9 100644
--- a/lib/client/theme/SearchModal/SearchResult.jsx
+++ b/lib/client/theme/SearchModal/SearchResult.jsx
@@ -52,7 +52,7 @@ const SearchResult = (props) => {
url += `?${buildDestinationQueryParams(tokens)}`;
}
if (h) {
- url += h;
+ url = h;
}
history.push(url);
onClick();
diff --git a/lib/client/theme/SearchPage/SearchPage.jsx b/lib/client/theme/SearchPage/SearchPage.jsx
index 1f594dde9a1196c15b26944f57fcc2affcfe6f99..102e690848656a22b3e43696b9ed6297ca2f24f6 100644
--- a/lib/client/theme/SearchPage/SearchPage.jsx
+++ b/lib/client/theme/SearchPage/SearchPage.jsx
@@ -112,7 +112,7 @@ function SearchResultItem({ searchResult: { document, type, page, tokens, metada
}
return (<article className={styles.searchResultItem}>
<h2>
- <Link to={document.u + (document.h || "")} dangerouslySetInnerHTML={{
+ <Link to={document.h ? document.h : document.u} dangerouslySetInnerHTML={{
__html: isContent
? highlight(articleTitle, tokens)
: highlightStemmed(articleTitle, getStemmedPositions(metadata, "t"), tokens, 100),
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@docusaurus/preset-classic": "^3.4.0",
"@mdx-js/react": "^3.0.1",
"clsx": "^2.1.1",
"docusaurus-plugin-search-local": "^2.0.1",
"docusaurus-plugin-search-local": "patch:docusaurus-plugin-search-local@npm%3A2.0.1#./.yarn/patches/docusaurus-plugin-search-local-npm-2.0.1-4a07fbb27a.patch",
"prism-react-renderer": "^2.3.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down Expand Up @@ -53,4 +53,4 @@
"engines": {
"node": ">=18.0"
}
}
}
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3544,7 +3544,7 @@ dns-packet@^5.2.2:
dependencies:
"@leichtgewicht/ip-codec" "^2.0.1"

docusaurus-plugin-search-local@^2.0.1:
"docusaurus-plugin-search-local@patch:docusaurus-plugin-search-local@npm%3A2.0.1#./.yarn/patches/docusaurus-plugin-search-local-npm-2.0.1-4a07fbb27a.patch":
version "2.0.1"
resolved "https://registry.yarnpkg.com/docusaurus-plugin-search-local/-/docusaurus-plugin-search-local-2.0.1.tgz#2de0eb392016ac753164e1376f4fa408455576ba"
integrity sha512-vS6LpTjHg4tkHLbnJqUH2v2sOM0/1HPXrQ1hXtxYalV/NCgaOLD2T+vjVvGbIkqxf91/h+Rzk2HydnyeAsa5Xw==
Expand Down

0 comments on commit f816ca8

Please sign in to comment.