Skip to content

Commit ebc75e9

Browse files
サイト内検索 (#10)
* サイト内検索を有効化 * add translations --------- Co-authored-by: kakkokari-gtyih <[email protected]>
1 parent b2d0509 commit ebc75e9

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

.vitepress/config/ja.ts

+22
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,25 @@ export const ja = defineConfig({
5656
returnToTopLabel: 'ページの先頭に戻る',
5757
},
5858
});
59+
60+
export const jaSearchLocale: NonNullable<DefaultTheme.LocalSearchOptions['translations']> = {
61+
button: {
62+
buttonText: '検索',
63+
buttonAriaLabel: '検索する',
64+
},
65+
modal: {
66+
displayDetails: '詳細を表示',
67+
resetButtonTitle: 'リセット',
68+
backButtonTitle: '閉じる',
69+
noResultsText: '該当する結果がありませんでした',
70+
footer: {
71+
selectText: 'で選択',
72+
selectKeyAriaLabel: 'Enterキー',
73+
navigateText: 'で移動',
74+
navigateUpKeyAriaLabel: '上矢印キー',
75+
navigateDownKeyAriaLabel: '下矢印キー',
76+
closeText: 'で閉じる',
77+
closeKeyAriaLabel: '閉じる',
78+
},
79+
},
80+
};

.vitepress/config/shared.ts

+11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { defineConfig } from 'vitepress';
22
import aiscriptTmLanguage from 'aiscript-vscode/aiscript/syntaxes/aiscript.tmLanguage.json' with { type: 'json' };
3+
import { jaSearchLocale } from './ja';
34
import { createPlaygroundTransformer } from '../scripts/playground-transformer';
45

56
// https://vitepress.dev/reference/site-config
@@ -12,6 +13,16 @@ export const shared = defineConfig({
1213
socialLinks: [
1314
{ icon: 'github', link: 'https://github.com/aiscript-dev/aiscript' },
1415
],
16+
search: {
17+
provider: 'local',
18+
options: {
19+
locales: {
20+
ja: {
21+
translations: jaSearchLocale,
22+
},
23+
}
24+
}
25+
},
1526
},
1627

1728
head: [

0 commit comments

Comments
 (0)