@easyops-cn/docusaurus-search-local 0.48.2 → 0.48.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [0.48.4](https://github.com/easyops-cn/docusaurus-search-local/compare/v0.48.3...v0.48.4) (2025-01-20)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* handle keywords stemmer, fix [#487](https://github.com/easyops-cn/docusaurus-search-local/issues/487) ([23ba48d](https://github.com/easyops-cn/docusaurus-search-local/commit/23ba48deef88b6dc081b986bda47c938bec26119))
|
|
11
|
+
|
|
12
|
+
## [0.48.3](https://github.com/easyops-cn/docusaurus-search-local/compare/v0.48.2...v0.48.3) (2025-01-16)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* sync ssr the input value and focus state for SSR ([be7c125](https://github.com/easyops-cn/docusaurus-search-local/commit/be7c125d72f7274eabc8d377809cddfd85fb1db1))
|
|
18
|
+
|
|
5
19
|
## [0.48.2](https://github.com/easyops-cn/docusaurus-search-local/compare/v0.48.1...v0.48.2) (2025-01-16)
|
|
6
20
|
|
|
7
21
|
|
|
@@ -288,6 +288,23 @@ export default function SearchBar({ handleSearchBarToggle, }) {
|
|
|
288
288
|
const isMac = isBrowser
|
|
289
289
|
? /mac/i.test(navigator.userAgentData?.platform ?? navigator.platform)
|
|
290
290
|
: false;
|
|
291
|
+
// Sync the input value and focus state for SSR
|
|
292
|
+
useEffect(() => {
|
|
293
|
+
const searchBar = searchBarRef.current;
|
|
294
|
+
const domValue = searchBar?.value;
|
|
295
|
+
if (domValue) {
|
|
296
|
+
setInputValue(domValue);
|
|
297
|
+
}
|
|
298
|
+
if (searchBar && document.activeElement === searchBar) {
|
|
299
|
+
focusAfterIndexLoaded.current = true;
|
|
300
|
+
loadIndex();
|
|
301
|
+
setFocused(true);
|
|
302
|
+
handleSearchBarToggle?.(true);
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
// Only run this effect on mount
|
|
306
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
307
|
+
[]);
|
|
291
308
|
useEffect(() => {
|
|
292
309
|
if (!searchBarShortcut) {
|
|
293
310
|
return;
|
|
@@ -9,7 +9,7 @@ function parseDocument($) {
|
|
|
9
9
|
const $pageTitle = $("article h1").first();
|
|
10
10
|
const pageTitle = $pageTitle.text();
|
|
11
11
|
const description = $("meta[name='description']").attr("content") || "";
|
|
12
|
-
const keywords = $("meta[name='keywords']").attr("content") || "";
|
|
12
|
+
const keywords = ($("meta[name='keywords']").attr("content") || "").replace(/,/g, ", ");
|
|
13
13
|
const sections = [];
|
|
14
14
|
const breadcrumb = [];
|
|
15
15
|
const navbarActiveItem = $(".navbar__link--active");
|