|
| 1 | +import { createRequire } from 'module' |
| 2 | +import { defineConfig, type DefaultTheme } from 'vitepress' |
| 3 | + |
| 4 | +const require = createRequire(import.meta.url) |
| 5 | +const pkg = require('vitepress/package.json') |
| 6 | + |
| 7 | +export const fa = defineConfig({ |
| 8 | + title: 'ویتپرس', |
| 9 | + lang: 'fa-IR', |
| 10 | + description: 'Vite & Vue powered static site generator.', |
| 11 | + dir: 'rtl', |
| 12 | + markdown: { |
| 13 | + container: { |
| 14 | + tipLabel: 'نکته', |
| 15 | + warningLabel: 'هشدار', |
| 16 | + dangerLabel: 'خطر', |
| 17 | + infoLabel: 'اطلاعات', |
| 18 | + detailsLabel: 'جزئیات' |
| 19 | + } |
| 20 | + }, |
| 21 | + themeConfig: { |
| 22 | + nav: nav(), |
| 23 | + sidebar: { |
| 24 | + '/fa/guide/': { base: '/fa/guide/', items: sidebarGuide() }, |
| 25 | + '/fa/reference/': { base: '/fa/reference/', items: sidebarReference() } |
| 26 | + }, |
| 27 | + |
| 28 | + editLink: { |
| 29 | + pattern: 'https://github.com/vuejs/vitepress/edit/main/docs/:path', |
| 30 | + text: 'ویرایش این صفحه در گیتهاب' |
| 31 | + }, |
| 32 | + |
| 33 | + footer: { |
| 34 | + message: 'انتشار یافته تحت لایسنس MIT', |
| 35 | + copyright: 'حق نسخهبرداری © 2019-کنون Evan You' |
| 36 | + }, |
| 37 | + |
| 38 | + docFooter: { |
| 39 | + prev: 'قبلی', |
| 40 | + next: 'بعدی' |
| 41 | + }, |
| 42 | + |
| 43 | + outline: { |
| 44 | + label: 'در این صفحه' |
| 45 | + }, |
| 46 | + |
| 47 | + lastUpdated: { |
| 48 | + text: 'آخرین بهروزرسانی', |
| 49 | + formatOptions: { |
| 50 | + dateStyle: 'short', |
| 51 | + timeStyle: 'medium' |
| 52 | + } |
| 53 | + }, |
| 54 | + |
| 55 | + langMenuLabel: 'تغییر زبان', |
| 56 | + returnToTopLabel: 'بازگشت به بالا', |
| 57 | + sidebarMenuLabel: 'منوی جانبی', |
| 58 | + darkModeSwitchLabel: 'تم تاریک', |
| 59 | + lightModeSwitchTitle: 'رفتن به حالت روشن', |
| 60 | + darkModeSwitchTitle: 'رفتن به حالت تاریک', |
| 61 | + notFound: { |
| 62 | + linkLabel: 'بازگشت به خانه', |
| 63 | + linkText: 'بازگشت به خانه', |
| 64 | + title: 'صفحه مورد نظر یافت نشد', |
| 65 | + code: '۴۰۴', |
| 66 | + quote: |
| 67 | + 'اما اگر جهت خود را تغییر ندهید و اگر ادامه دهید به دنبال چیزی که دنبال میکنید، ممکن است در نهایت به جایی که در حال رفتن به سمتش هستید، برسید.' |
| 68 | + }, |
| 69 | + siteTitle: 'ویتپرس' |
| 70 | + } |
| 71 | +}) |
| 72 | + |
| 73 | +function nav(): DefaultTheme.NavItem[] { |
| 74 | + return [ |
| 75 | + { |
| 76 | + text: 'راهنما', |
| 77 | + link: 'fa/guide/what-is-vitepress', |
| 78 | + activeMatch: '/guide/' |
| 79 | + }, |
| 80 | + { |
| 81 | + text: 'مرجع', |
| 82 | + link: 'fa/reference/site-config', |
| 83 | + activeMatch: '/reference/' |
| 84 | + }, |
| 85 | + { |
| 86 | + text: pkg.version, |
| 87 | + items: [ |
| 88 | + { |
| 89 | + text: 'Changelog', |
| 90 | + link: 'https://github.com/vuejs/vitepress/blob/main/CHANGELOG.md' |
| 91 | + }, |
| 92 | + { |
| 93 | + text: 'مشارکت', |
| 94 | + link: 'https://github.com/vuejs/vitepress/blob/main/.github/contributing.md' |
| 95 | + } |
| 96 | + ] |
| 97 | + } |
| 98 | + ] |
| 99 | +} |
| 100 | + |
| 101 | +function sidebarGuide(): DefaultTheme.SidebarItem[] { |
| 102 | + return [ |
| 103 | + { |
| 104 | + text: 'معرفی', |
| 105 | + collapsed: false, |
| 106 | + items: [ |
| 107 | + { text: 'ویتپرس چیست؟', link: 'what-is-vitepress' }, |
| 108 | + { text: 'شروع کار', link: 'getting-started' }, |
| 109 | + { text: 'مسیریابی', link: 'routing' }, |
| 110 | + { text: 'استقرار', link: 'deploy' } |
| 111 | + ] |
| 112 | + }, |
| 113 | + { |
| 114 | + text: 'نوشتن', |
| 115 | + collapsed: false, |
| 116 | + items: [ |
| 117 | + { text: 'افزونههای Markdown', link: 'markdown' }, |
| 118 | + { text: 'مدیریت منابع', link: 'asset-handling' }, |
| 119 | + { text: 'Frontmatter', link: 'frontmatter' }, |
| 120 | + { text: 'استفاده از Vue در Markdown', link: 'using-vue' }, |
| 121 | + { text: 'بینالمللی سازی', link: 'i18n' } |
| 122 | + ] |
| 123 | + }, |
| 124 | + { |
| 125 | + text: 'شخصیسازی', |
| 126 | + collapsed: false, |
| 127 | + items: [ |
| 128 | + { text: 'استفاده از تم شخصی', link: 'custom-theme' }, |
| 129 | + { |
| 130 | + text: 'گسترش تم پیشفرض', |
| 131 | + link: 'extending-default-theme' |
| 132 | + }, |
| 133 | + { text: 'بارگیری داده در زمان Build', link: 'data-loading' }, |
| 134 | + { text: 'سازگاری SSR', link: 'ssr-compat' }, |
| 135 | + { text: 'اتصال به CMS', link: 'cms' } |
| 136 | + ] |
| 137 | + }, |
| 138 | + { |
| 139 | + text: 'آزمایشی', |
| 140 | + collapsed: false, |
| 141 | + items: [ |
| 142 | + { text: 'حالت MPA', link: 'mpa-mode' }, |
| 143 | + { text: 'جنریت کردن Sitemap', link: 'sitemap-generation' } |
| 144 | + ] |
| 145 | + }, |
| 146 | + { text: 'پیکربندی و مرجع API', base: 'fa/reference/', link: 'site-config' } |
| 147 | + ] |
| 148 | +} |
| 149 | + |
| 150 | +function sidebarReference(): DefaultTheme.SidebarItem[] { |
| 151 | + return [ |
| 152 | + { |
| 153 | + text: 'مرجع', |
| 154 | + base: 'fa/reference/', |
| 155 | + items: [ |
| 156 | + { text: 'پیکربندی Site', link: 'site-config' }, |
| 157 | + { text: 'پیکربندی Frontmatter', link: 'frontmatter-config' }, |
| 158 | + { text: 'Runtime API', link: 'runtime-api' }, |
| 159 | + { text: 'CLI', link: 'cli' }, |
| 160 | + { |
| 161 | + text: 'تم پیشفرض', |
| 162 | + base: 'fa/reference/default-theme-', |
| 163 | + items: [ |
| 164 | + { text: 'بررسی اجمالی', link: 'config' }, |
| 165 | + { text: 'ناوبری', link: 'nav' }, |
| 166 | + { text: 'نوار کنار صفحه', link: 'sidebar' }, |
| 167 | + { text: 'صفحه اصلی', link: 'home-page' }, |
| 168 | + { text: 'پاورقی', link: 'footer' }, |
| 169 | + { text: 'طرح', link: 'layout' }, |
| 170 | + { text: 'نشان', link: 'badge' }, |
| 171 | + { text: 'صفحه تیم', link: 'team-page' }, |
| 172 | + { text: 'لینکهای قبلی / بعدی', link: 'prev-next-links' }, |
| 173 | + { text: 'ویرایش لینک', link: 'edit-link' }, |
| 174 | + { text: 'Timestamp آخرین بهروزرسانی', link: 'last-updated' }, |
| 175 | + { text: 'جستجو', link: 'search' }, |
| 176 | + { text: 'تبلیغات Carbon', link: 'carbon-ads' } |
| 177 | + ] |
| 178 | + } |
| 179 | + ] |
| 180 | + } |
| 181 | + ] |
| 182 | +} |
| 183 | + |
| 184 | +export const search: DefaultTheme.AlgoliaSearchOptions['locales'] = { |
| 185 | + fa: { |
| 186 | + placeholder: 'جستجوی مستندات', |
| 187 | + translations: { |
| 188 | + button: { |
| 189 | + buttonText: 'جستجو', |
| 190 | + buttonAriaLabel: 'جستجو' |
| 191 | + }, |
| 192 | + modal: { |
| 193 | + searchBox: { |
| 194 | + resetButtonTitle: 'آغاز مجدد جستجو', |
| 195 | + resetButtonAriaLabel: 'آغاز مجدد جستجو', |
| 196 | + cancelButtonText: 'لغو', |
| 197 | + cancelButtonAriaLabel: 'لغو' |
| 198 | + }, |
| 199 | + startScreen: { |
| 200 | + recentSearchesTitle: 'جستجوهای اخیر', |
| 201 | + noRecentSearchesText: 'تاریخچه جستجویی یافت نشد.', |
| 202 | + saveRecentSearchButtonTitle: 'ذخیره تاریخچه جستجو', |
| 203 | + removeRecentSearchButtonTitle: 'حذف تاریخچه جستجو', |
| 204 | + favoriteSearchesTitle: 'موارد دلخواه', |
| 205 | + removeFavoriteSearchButtonTitle: 'حذف مورد دلخواه' |
| 206 | + }, |
| 207 | + errorScreen: { |
| 208 | + titleText: 'نتیجهای یافت نشد برای', |
| 209 | + helpText: 'اتصال شبکه خود را بررسی کنید' |
| 210 | + }, |
| 211 | + footer: { |
| 212 | + selectText: 'انتخاب', |
| 213 | + navigateText: 'رفتن', |
| 214 | + closeText: 'بستن', |
| 215 | + searchByText: ' جستجو با ' |
| 216 | + }, |
| 217 | + noResultsScreen: { |
| 218 | + noResultsText: 'نتیجهای یافت نشد برای' |
| 219 | + } |
| 220 | + } |
| 221 | + } |
| 222 | + } |
| 223 | +} |
0 commit comments