From ebc75e96e157675210126c8e96b97d7e78243877 Mon Sep 17 00:00:00 2001 From: uzmoi Date: Fri, 6 Dec 2024 09:43:49 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=B5=E3=82=A4=E3=83=88=E5=86=85=E6=A4=9C?= =?UTF-8?q?=E7=B4=A2=20(#10)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * サイト内検索を有効化 * add translations --------- Co-authored-by: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> --- .vitepress/config/ja.ts | 22 ++++++++++++++++++++++ .vitepress/config/shared.ts | 11 +++++++++++ 2 files changed, 33 insertions(+) diff --git a/.vitepress/config/ja.ts b/.vitepress/config/ja.ts index 260e8dc..f3e6903 100644 --- a/.vitepress/config/ja.ts +++ b/.vitepress/config/ja.ts @@ -56,3 +56,25 @@ export const ja = defineConfig({ returnToTopLabel: 'ページの先頭に戻る', }, }); + +export const jaSearchLocale: NonNullable = { + button: { + buttonText: '検索', + buttonAriaLabel: '検索する', + }, + modal: { + displayDetails: '詳細を表示', + resetButtonTitle: 'リセット', + backButtonTitle: '閉じる', + noResultsText: '該当する結果がありませんでした', + footer: { + selectText: 'で選択', + selectKeyAriaLabel: 'Enterキー', + navigateText: 'で移動', + navigateUpKeyAriaLabel: '上矢印キー', + navigateDownKeyAriaLabel: '下矢印キー', + closeText: 'で閉じる', + closeKeyAriaLabel: '閉じる', + }, + }, +}; diff --git a/.vitepress/config/shared.ts b/.vitepress/config/shared.ts index 7fe56fc..0769f33 100644 --- a/.vitepress/config/shared.ts +++ b/.vitepress/config/shared.ts @@ -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 @@ -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: [