Skip to content

Commit

Permalink
サイト内検索 (#10)
Browse files Browse the repository at this point in the history
* サイト内検索を有効化

* add translations

---------

Co-authored-by: kakkokari-gtyih <[email protected]>
  • Loading branch information
uzmoi and kakkokari-gtyih authored Dec 6, 2024
1 parent b2d0509 commit ebc75e9
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .vitepress/config/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,25 @@ export const ja = defineConfig({
returnToTopLabel: 'ページの先頭に戻る',
},
});

export const jaSearchLocale: NonNullable<DefaultTheme.LocalSearchOptions['translations']> = {
button: {
buttonText: '検索',
buttonAriaLabel: '検索する',
},
modal: {
displayDetails: '詳細を表示',
resetButtonTitle: 'リセット',
backButtonTitle: '閉じる',
noResultsText: '該当する結果がありませんでした',
footer: {
selectText: 'で選択',
selectKeyAriaLabel: 'Enterキー',
navigateText: 'で移動',
navigateUpKeyAriaLabel: '上矢印キー',
navigateDownKeyAriaLabel: '下矢印キー',
closeText: 'で閉じる',
closeKeyAriaLabel: '閉じる',
},
},
};
11 changes: 11 additions & 0 deletions .vitepress/config/shared.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { defineConfig } from 'vitepress';
import aiscriptTmLanguage from 'aiscript-vscode/aiscript/syntaxes/aiscript.tmLanguage.json' with { type: 'json' };
import { jaSearchLocale } from './ja';
import { createPlaygroundTransformer } from '../scripts/playground-transformer';

// https://vitepress.dev/reference/site-config
Expand All @@ -12,6 +13,16 @@ export const shared = defineConfig({
socialLinks: [
{ icon: 'github', link: 'https://github.com/aiscript-dev/aiscript' },
],
search: {
provider: 'local',
options: {
locales: {
ja: {
translations: jaSearchLocale,
},
}
}
},
},

head: [
Expand Down

0 comments on commit ebc75e9

Please sign in to comment.