Skip to content

Commit

Permalink
docs: base url + algolia i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
prazdevs committed Aug 30, 2024
1 parent d74cf2f commit 89d9f93
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 6 deletions.
50 changes: 50 additions & 0 deletions docs/.vitepress/config/algolia.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import type { DefaultTheme } from 'vitepress'

export const algolia: DefaultTheme.AlgoliaSearchOptions = {
appId: '90OL5Y5T3K',
apiKey: '20f9f00e8b98bae16d443559f1879aa9',
indexName: 'pinia-plugin-persistedstate',
locales: {
zh: {
placeholder: '搜索文档',
translations: {
button: {
buttonText: '搜索文档',
buttonAriaLabel: '搜索文档',
},
modal: {
searchBox: {
resetButtonTitle: '清除查询条件',
resetButtonAriaLabel: '清除查询条件',
cancelButtonText: '取消',
cancelButtonAriaLabel: '取消',
},
startScreen: {
recentSearchesTitle: '搜索历史',
noRecentSearchesText: '没有搜索历史',
saveRecentSearchButtonTitle: '保存至搜索历史',
removeRecentSearchButtonTitle: '从搜索历史中移除',
favoriteSearchesTitle: '收藏',
removeFavoriteSearchButtonTitle: '从收藏中移除',
},
errorScreen: {
titleText: '无法获取结果',
helpText: '你可能需要检查你的网络连接',
},
footer: {
selectText: '选择',
navigateText: '切换',
closeText: '关闭',
searchByText: '搜索提供者',
},
noResultsScreen: {
noResultsText: '无法找到相关结果',
suggestedQueryText: '你可以尝试查询',
reportMissingResultsText: '你认为该查询应该有结果?',
reportMissingResultsLinkText: '点击反馈',
},
},
},
},
},
}
9 changes: 3 additions & 6 deletions docs/.vitepress/config/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { defineConfig } from 'vitepress'
import { transformerTwoslash } from '@shikijs/vitepress-twoslash'
import { algolia } from './algolia'
import { en } from './en'

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: 'Pinia Plugin Persistedstate',
base: '/pinia-plugin-persistedstate/',
head: [['link', { rel: 'icon', href: '/favicon.ico' }]],
lastUpdated: true,
markdown: {
Expand All @@ -24,11 +25,7 @@ export default defineConfig({
},
search: {
provider: 'algolia',
options: {
appId: '90OL5Y5T3K',
apiKey: '20f9f00e8b98bae16d443559f1879aa9',
indexName: 'pinia-plugin-persistedstate',
},
options: algolia,
},
socialLinks: [
{ icon: 'github', link: 'https://github.com/prazdevs/pinia-plugin-persistedstate' },
Expand Down

0 comments on commit 89d9f93

Please sign in to comment.