Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: migrate to vitepress #2735

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ node_modules

package-lock.json
test/setup/context.json
docs/.vitepress/cache
3 changes: 0 additions & 3 deletions docs/.env.example

This file was deleted.

12 changes: 0 additions & 12 deletions docs/.gitignore

This file was deleted.

117 changes: 117 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
import { defineConfig } from 'vitepress'

const gettingStarted = {
text: 'Getting Started',
items: [
{ text: 'Setup', link: '/getting-started/setup' },
{ text: 'Basic usage', link: '/getting-started/basic-usage' }
]
}

const guides = {
text: 'Guides',
items: [
{ text: 'Routing stratagies', link: '/guide/routing-strategies' },
{ text: 'Runtime hooks', link: '/guide/runtime-hooks' },
{ text: 'Custom paths', link: '/guide/custom-paths' },
{ text: 'Ignoring localized routes', link: '/guide/ignoring-localized-routes' },
{ text: 'Browser language detection', link: '/guide/browser-language-detection' },
{ text: 'SEO', link: '/guide/seo' },
{ text: 'Lazy-load translations', link: '/guide/lazy-load-translations' },
{ text: 'Lang switcher', link: '/guide/lang-switcher' },
{ text: 'Different domains', link: '/guide/different-domains' },
{ text: 'Locale fallback', link: '/guide/locale-fallback' },
{ text: 'Per-component translations', link: '/guide/per-component-translations' },
{ text: 'Extending messages hook', link: '/guide/extend-messages' },
{ text: 'Extending pages', link: '/guide/extend-pages' },
{ text: 'Layers', link: '/guide/layers' },
{ text: 'Server-side Translations', link: '/guide/server-side-translations' },
{ text: 'Migration guide', link: '/guide/migrating' }
]
}

const options = {
text: 'Options',
items: [
{ text: 'Vue I18n', link: '/options/vue-i18n' },
{ text: 'Routing', link: '/options/routing' },
{ text: 'Lazy', link: '/options/lazy' },
{ text: 'Browser', link: '/options/browser' },
{ text: 'Domain', link: '/options/domain' },
{ text: 'Compilation', link: '/options/compilation' },
{ text: 'Bundle', link: '/options/bundle' },
{ text: 'Custom block', link: '/options/custom-block' },
{ text: 'Runtime config', link: '/options/runtime-config' },
{ text: 'Misc', link: '/options/misc' }
]
}

const api = {
text: 'API',
items: [
{ text: 'Composables', link: '/api/composables' },
{ text: 'Components', link: '/api/components' },
{ text: 'Compiler macros', link: '/api/compiler-macros' },
{ text: 'Vue i18n', link: '/api/vue-i18n' },
{ text: 'Vue', link: '/api/vue' },
{ text: 'Nuxt', link: '/api/nuxt' }
]
}

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: 'nuxt/i18n',
description: 'Internationalization for Nuxt Applications.',

head: [
['link', { rel: 'icon', type: 'image/svg+xml', href: '/public/logo.svg' }],
['link', { rel: 'icon', type: 'image/png', href: '/public/logo.png' }]
],
themeConfig: {
search: {
provider: 'local'
},
logo: '/icon.svg',
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: 'Home', link: '/' },
gettingStarted,
guides,
options,
api,
{ text: 'Roadmap', link: '/roadmap' },
{ text: 'v7 Docs', link: '/v7/setup' }
],

sidebar: {
'/': [gettingStarted, guides, options, api],
'/v7/': [
{
text: 'v7',
items: [
{ text: 'Setup', link: '/v7/setup' },
{ text: 'Basic usage', link: '/v7/basic-usage' },
{ text: 'Options', link: '/v7/options-reference' },
{ text: 'Callbacks', link: '/v7/callbacks' },
{ text: 'Routing', link: '/v7/routing' },
{ text: 'Strategies', link: '/v7/strategies' },
{ text: 'Custom route paths', link: '/v7/custom-paths' },
{ text: 'Ignoring localized routes', link: '/v7/ignoring-localized-routes' },
{ text: 'Browser language detection', link: '/v7/browser-language-detection' },
{ text: 'SEO', link: '/v7/seo' },
{ text: 'Lazy-load translations', link: '/v7/lazy-load-translations' },
{ text: 'Lang switcher', link: '/v7/lang-switcher' },
{ text: 'Different domains', link: '/v7/different-domains' },
{ text: 'Locale fallback', link: '/v7/locale-fallback' },
{ text: 'Per-component translations', link: '/v7/per-component-translations' },
{ text: 'Extending messages hook', link: '/v7/extend-messages' },
{ text: 'Migration guide', link: '/v7/migrating' },
{ text: 'API Refrences', link: '/v7/api' }
]
}
]
},

socialLinks: [{ icon: 'github', link: 'https://github.com/vuejs/vitepress' }]
}
})
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
</template>

<script setup lang="ts">
import { computed } from 'vue'
const props = defineProps({
token: {
type: String,
Expand Down
18 changes: 18 additions & 0 deletions docs/.vitepress/theme/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* .vitepress/theme/custom.css */
:root {
--vp-c-brand-1: #059669;
--vp-c-brand-2: #10b981;
--vp-button-brand-bg: #059669;

}

/* 50: { value: '#ecfdf5' }, */
/* 100: { value: '#d1fae5' }, */
/* 200: { value: '#a7f3d0' }, */
/* 300: { value: '#6ee7b7' }, */
/* 400: { value: '#34d399' }, */
/* 500: { value: '#10b981' }, */
/* 600: { value: '#059669' }, */
/* 700: { value: '#047857' }, */
/* 800: { value: '#065f46' }, */
/* 900: { value: '#064e3b' } */
5 changes: 5 additions & 0 deletions docs/.vitepress/theme/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// .vitepress/theme/index.js
import DefaultTheme from 'vitepress/theme'
import './custom.css'

export default DefaultTheme
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

Compiler Macros for Nuxt i18n module.

---

## `defineI18nRoute`

`defineI18nRoute` is a compiler macro that you can use to set custom route paths for your **page** components located in the `pages/` directory (unless [set otherwise](https://nuxt.com/docs/api/configuration/nuxt-config#pages-1)). This way you can set custom route paths for each static or dynamic route of your Nuxt application.

:::code-group
```vue [pages/some-page.vue]
<script setup>
defineI18nRoute({
Expand All @@ -19,6 +18,7 @@ defineI18nRoute({
})
</script>
```
:::

## Type

Expand Down
File renamed without changes.
Loading