Skip to content

Commit

Permalink
feat(docs): upgrade to latest Docus (#1702)
Browse files Browse the repository at this point in the history
* feat(docs): upgrade to latest Docus

* chore(format): fix
  • Loading branch information
Tahul authored Dec 7, 2022
1 parent 4e2aeb4 commit dfceb0a
Show file tree
Hide file tree
Showing 31 changed files with 155 additions and 176 deletions.
85 changes: 31 additions & 54 deletions docs/components/content/Logo.vue

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions docs/content/1.getting-started/1.setup.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
title: Setup
---
# Setup

::alert{type="warning"}
❗IMPORTANT
Expand Down
7 changes: 4 additions & 3 deletions docs/content/1.getting-started/2.basic-usage.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Basic Usage
description: 'The basic to get started with @nuxtjs/i18n is to translate with Vue I18n via the `vueI18n` option'
# Basic Usage

The basic to get started with @nuxtjs/i18n is to translate with Vue I18n via the `vueI18n` option.

---

## Translate with Vue I18n
Expand Down
3 changes: 2 additions & 1 deletion docs/content/1.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
title: I18n for Nuxt developers
description: I18n (Internationalization) for your Nuxt project powered by Vue I18n
layout: page
page.fluid: true
navigation: false
---

:ellipsis{right=0px width=75% blur=150px}

::block-hero
---
cta:
Expand Down
10 changes: 6 additions & 4 deletions docs/content/2.guide/1.routing-strategies.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Routing & Strategies

@nuxtjs/i18n overrides Nuxt default routes to add locale prefixes to every URL with routing strategies.

---
title: Routing & Strategies
description: '@nuxtjs/i18n overrides Nuxt default routes to add locale prefixes to every URL with routing strategies'
---


## Routing

Expand All @@ -11,7 +13,7 @@ Say your app supports two languages: French and English as the default language,
```asciidoc
└── pages
├── about
   └── index.vue
└── index.vue
└── index.vue
```

Expand Down
9 changes: 5 additions & 4 deletions docs/content/2.guide/10.different-domains.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
title: Different domains
description: 'You might want to use a different domain name for each language your app supports. To achieve this:'
# Different domains

You might want to use a different domain name for each language your app supports.

---

You might want to use a different domain name for each language your app supports. To achieve this:
Here is how to achieve this:

- Set `differentDomains` option to `true`
- Configure the `locales` option as an array of objects, where each object has a `domain` key whose value is the domain name you'd like to use for that locale. Optionally include a port (if non-standard) and/or a protocol. If the protocol is not provided then an attempt will be made to auto-detect it but that might not work correctly in some cases like when the pages are statically generated.
Expand Down
7 changes: 4 additions & 3 deletions docs/content/2.guide/11.locale-fallback.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Locale fallback
description: 'How a fallback gets selected when a translation is missing'
# Locale fallback

How a fallback gets selected when a translation is missing.

---

**@nuxtjs/i18n** takes advantage of **Vue I18n** ability to handle localization fallback. It is possible to define a single fallback locale, an array of locales,
Expand Down
7 changes: 4 additions & 3 deletions docs/content/2.guide/12.per-component-translations.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Per-component translations
description: 'enable vue-i18n-loader'
# Per-component translations

Enable vue-i18n-loader.

---

If you'd like to define translations per-page or per-component you can take advantage with i18n custom block.
Expand Down
7 changes: 4 additions & 3 deletions docs/content/2.guide/13.extend-messages.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Extending messages hook
description: "Nuxt hook to extend app's messages"
# Extending messages hook

Nuxt hook to extend app's messages.

---

If you're a **module author** and want that module to provide extra messages for your project, you can merge them into the normally loaded messages by using the `i18n:extend-messages` hook.
Expand Down
7 changes: 3 additions & 4 deletions docs/content/2.guide/14.migrating.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
title: Migration guide
description: Follow this guide to upgrade from one major version to the other.
---
# Migration guide

Follow this guide to upgrade from one major version to the other.

---

## Upgrading from `nuxtjs/i18n` v7.x

### Change the route key rules in `pages` option
Expand Down
7 changes: 4 additions & 3 deletions docs/content/2.guide/2.callbacks.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Callbacks
description: "@nuxtjs/i18n exposes some callbacks that you can use to perform specific tasks that depend on the app's language."
# Callbacks

@nuxtjs/i18n exposes some callbacks that you can use to perform specific tasks that depend on the app's language.

---

**@nuxtjs/i18n** exposes some callbacks that you can use to perform specific tasks that depend on the app's language.
Expand Down
7 changes: 4 additions & 3 deletions docs/content/2.guide/4.custom-paths.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Custom route paths
description: 'Customize the names of the paths for specific locale.'
# Custom route paths

Customize the names of the paths for specific locale.

---

In some cases, you might want to translate URLs in addition to having them prefixed with the locale code. There are 2 ways of configuring custom paths for your [Module configuration](#nodule-configuration) or your pages [Page component](#page-component).
Expand Down
7 changes: 4 additions & 3 deletions docs/content/2.guide/5.ignoring-localized-routes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Ignoring localized routes
description: 'Customize localized route exlusions per page component.'
# Ignoring localized routes

Customize localized route exlusions per page component.

---

::alert{type="warning"}
Expand Down
9 changes: 4 additions & 5 deletions docs/content/2.guide/6.browser-language-detection.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
title: Browser language detection
description: "By default, @nuxtjs/i18n attempts to redirect users to their preferred language by detecting their browser's language. This is controlled by the `detectBrowserLanguage` option:"
---
# Browser language detection

By default, **@nuxtjs/i18n** attempts to redirect users to their preferred language by detecting their browser's language. This is controlled by the `detectBrowserLanguage` option:
By default, @nuxtjs/i18n attempts to redirect users to their preferred language by detecting their browser's language. This is controlled by the `detectBrowserLanguage` option.

---

```js {}[nuxt.config.js]
export default defineNuxtConfig({
Expand Down
7 changes: 4 additions & 3 deletions docs/content/2.guide/7.seo.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: SEO
description: "When the `useLocaleHead` is called, @nuxtjs/i18n attempts to add some metadata to improve your pages SEO. Here's what it does"
# SEO

When the `useLocaleHead` is called, @nuxtjs/i18n attempts to add some metadata to improve your pages SEO. Here's what it does.

---

## Introduction
Expand Down
7 changes: 4 additions & 3 deletions docs/content/2.guide/8.lazy-load-translations.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Lazy-load translations
description: 'Lazy-load translations'
# Lazy-load translations

How to lazy-load translations.

---

For apps that contain a lot of translated content, it is preferable not to bundle all the messages in the main bundle but rather lazy-load only the language that the users selected.
Expand Down
7 changes: 3 additions & 4 deletions docs/content/2.guide/9.lang-switcher.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
title: Lang Switcher
description: 'When @nuxtjs/i18n loads in your app, it adds your `locales` configuration to `nuxtApp.$i18n` (or `this.$i18n`), which makes it really easy to display a lang switcher anywhere in your app.'
---
# Lang Switcher

When **@nuxtjs/i18n** loads in your app, it adds your `locales` configuration to `nuxtApp.$i18n` (or `this.$i18n`), which makes it really easy to display a lang switcher anywhere in your app.

---

Here's an example lang switcher where a `name` key has been added to each locale object in order to display friendlier titles for each link:

```vue
Expand Down
7 changes: 4 additions & 3 deletions docs/content/3.options/1.vue-i18n.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Vue I18n
description: 'Related Vue I18n options'
# Vue I18n

Related Vue I18n options.

---

## `vueI18n`
Expand Down
9 changes: 5 additions & 4 deletions docs/content/3.options/2.routing.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Routing
description: Routing and Strategies options
# Routing

Routing and Strategies options.

---

## `baseUrl`
Expand Down Expand Up @@ -241,4 +242,4 @@ definPageMeta({
</template>
```

See more information in [Dynamic route parameters](/guide/lang-switcher#dynamic-route-parameters)
See more information in [Dynamic route parameters](/guide/lang-switcher#dynamic-route-parameters)
7 changes: 4 additions & 3 deletions docs/content/3.options/3.lazy.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Lazy loading
description: Lazy loading options
# Lazy loading

Lazy loading options.

---

## `lazy`
Expand Down
7 changes: 4 additions & 3 deletions docs/content/3.options/4.browser.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Browser
description: Browser locale management options
# Browser

Browser locale management options.

---

## `detectBrowserLanguage`
Expand Down
7 changes: 4 additions & 3 deletions docs/content/3.options/5.domain.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Domain
description: Related domain options
# Domain

Related domain options.

---

## `differentDomains`
Expand Down
7 changes: 4 additions & 3 deletions docs/content/3.options/6.misc.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Misc
description: Miscellaneous options
# Misc

Miscellaneous options.

---

## `types`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: Composables
description: 'Composition API for `@nuxtjs/i18n`'
---
# Composables

Composition API for `@nuxtjs/i18n`.

## useLocalePath()

Expand All @@ -28,4 +27,4 @@ description: 'Composition API for `@nuxtjs/i18n`'
// TODO:
## useCookieLocale

// TODO:
// TODO:
7 changes: 4 additions & 3 deletions docs/content/4.API/2.compiler-macros.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Compiler Macros
description: 'Compiler Macros for `@nuxtjs/i18n`'
# Compiler Macros

Compiler Macros for `@nuxtjs/i18n`.

---

## `defineI18nRoute`
Expand Down
6 changes: 6 additions & 0 deletions docs/content/4.API/3.vue-i18n.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ title: Vue I18n
description: Extension of Vue I18n
---

# Vue I18n

Extension of Vue I18n.

---

::alert{type="info"}
Instance of [Composer (for Composition API)](https://vue-i18n.intlify.dev/api/composition.html#composer) or [VueI18n (for Legacy API)](https://vue-i18n.intlify.dev/api/legacy.html#vuei18n) is exposed as `$i18n` on Vue instance.
::
Expand Down
7 changes: 4 additions & 3 deletions docs/content/4.API/4.vue.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Vue
description: Extension of Vue
# Vue

Extension of Vue.

---

## Extension of Vue
Expand Down
9 changes: 5 additions & 4 deletions docs/content/4.API/5.nuxt.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Nuxt
description: Other APIs
# Nuxt

Other APIs

---

## Extension of Nuxt runtime app context
Expand Down Expand Up @@ -72,4 +73,4 @@ export default defineNuxtModule({
}
```
See also [Extending messages hook](/guide/extend-messages)
See also [Extending messages hook](/guide/extend-messages)
16 changes: 12 additions & 4 deletions docs/content/changelog.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
---
layout: docs
toc: false
title: Changelog
description: Discover the latest updates.
navigation: false
---

::releases
::
# Changelog

Discover the latest updates.

---

::alert{type="warning"}
This page is work in progress.

[Visit this page](https://github.com/nuxt-modules/i18n/releases).
::
5 changes: 2 additions & 3 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"preview": "nuxi preview"
},
"devDependencies": {
"@nuxt-themes/docus": "npm:@nuxt-themes/docus-edge@latest",
"nuxt": "^3.0.0",
"@nuxtjs/tailwindcss": "latest"
"@nuxt-themes/docus": "^1.1.3",
"nuxt": "^3.0.0"
}
}
Loading

0 comments on commit dfceb0a

Please sign in to comment.