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/1.getting-started/9.layers.md (#19) #173

Merged
merged 2 commits into from
Jun 14, 2024
Merged
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
44 changes: 22 additions & 22 deletions docs/1.getting-started/9.layers.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
---
title: 'Layers'
description: Nuxt provides a powerful system that allows you to extend the default files, configs, and much more.
title: 'Слои'
description: Nuxt предоставляет мощную систему, которая позволяет расширять файлы по умолчанию, конфигурацию и многое другое.
navigation.icon: i-ph-stack-duotone
---

One of the core features of Nuxt 3 is the layers and extending support. You can extend a default Nuxt application to reuse components, utils, and configuration. The layers structure is almost identical to a standard Nuxt application which makes them easy to author and maintain.
Одной из основных особенностей Nuxt 3 являются слои и поддержка расширений. Вы можете расширить стандартное приложение Nuxt для повторного использования компонентов, утилит и конфигурации. Структура слоев практически идентична стандартному приложению Nuxt, что делает их простыми в создании и поддержке.

## Use Cases
## Случаи использования

- Share reusable configuration presets across projects using `nuxt.config` and `app.config`
- Create a component library using [`components/`](/docs/guide/directory-structure/components) directory
- Create utility and composable library using [`composables/`](/docs/guide/directory-structure/composables) and [`utils/`](/docs/guide/directory-structure/utils) directories
- Create Nuxt module presets
- Share standard setup across projects
- Create Nuxt themes
- Enhance code organization by implementing a modular architecture and support Domain-Driven Design (DDD) pattern in large scale projects.
- Переиспользование предустановок конфигурации в проектах с помощью `nuxt.config` и `app.config`
- Создание библиотеки компонентов, с использованием директории [`components/`](/docs/guide/directory-structure/components)
- Создание библиотек утилит и композаблов с использованием директорий [`composables/`](/docs/guide/directory-structure/composables) и [`utils/`](/docs/guide/directory-structure/utils)
- Создание предустановок модуля Nuxt
- Распространение стандартных настроек по всем проектам
- Создание тем Nuxt
- Улучшение организации кода за счет внедрения модульной архитектуры и поддержки шаблона Domain-Driven Design (DDD) в больших масштабируемых проектах.

## Использование

You can extend a layer by adding the [extends](/docs/api/nuxt-config#extends) property to the [`nuxt.config.ts`](/docs/guide/directory-structure/nuxt-config) file.
Вы можете расширить слой, добавив свойство [extends](/docs/api/nuxt-config#extends) в файл [`nuxt.config.ts`](/docs/guide/directory-structure/nuxt-config).

```ts [nuxt.config.ts]
export default defineNuxtConfig({
extends: [
'../base', // Extend from a local layer
'@my-themes/awesome', // Extend from an installed npm package
'github:my-themes/awesome#v1', // Extend from a git repository
'../base', // Расширение из локального слоя
'@my-themes/awesome', // Расширение из установленного пакета npm
'github:my-themes/awesome#v1', // Расширение из git репозитория
]
})
```

You can also pass an authentication token if you are extending from a private GitHub repository:
Вы также можете передать токен аутентификации, если вы расширяете из приватного GitHub репозитория:

```ts [nuxt.config.ts]
export default defineNuxtConfig({
extends: [
// per layer configuration
// конфигурация каждого слоя
['github:my-themes/private-awesome', { auth: process.env.GITHUB_TOKEN }]
]
})
```

Nuxt uses [unjs/c12](https://c12.unjs.io) and [unjs/giget](https://giget.unjs.io) for extending remote layers. Check the documentation for more information and all available options.
Nuxt использует [unjs/c12](https://c12.unjs.io) и [unjs/giget](https://giget.unjs.io) для расширения удаленных слоев. Обратитесь к документации для получения дополнительной информации и всех доступных опций.

::read-more{to="/docs/guide/going-further/layers"}
Read more about layers in the **Layer Author Guide**.
Подробнее о слоях читайте в **Руководстве для автора слоя**.
::

::tip{icon="i-ph-video-duotone" to="https://www.youtube.com/watch?v=lnFCM7c9f7I" target="_blank"}
Watch a video from Learn Vue about Nuxt Layers.
Посмотрите видео о слоях Nuxt от Learn Vue.
::

::tip{icon="i-ph-video-duotone" to="https://www.youtube.com/watch?v=fr5yo3aVkfA" target="_blank"}
Watch a video from Alexander Lichter about Nuxt Layers.
Посмотрите видео о слоях Nuxt от Александра Лихтера.
::

## Примеры
Expand All @@ -66,6 +66,6 @@ Watch a video from Alexander Lichter about Nuxt Layers.
target: _blank
ui.icon.base: text-black dark:text-white
---
A lightweight Nuxt theme to build a Markdown driven website. Powered by Nuxt Content, TailwindCSS and Iconify.
Легковесная тема Nuxt для создания сайта на основе Markdown. Работает на Nuxt Content, TailwindCSS и Iconify.
::
::
Loading