Skip to content

Commit

Permalink
fix: fix a section in the Next.js guide and add an example (#699)
Browse files Browse the repository at this point in the history
  • Loading branch information
illright authored Jul 24, 2024
1 parent 1b465f6 commit da2b6e6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
1 change: 1 addition & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ module.exports = {
metadata: cfg.metadata,

imageZoom: {
selector: ".markdown :not(a) > img",
options: {
background: "rgb(255 255 255 / 0.3)",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,26 @@ To comply with the principles of FSD, you should treat the NextJS `app` folder i
to resolve a conflict with the NextJS `pages` folder.

The approach is to move the NextJS `app` folder to the root folder of the project and import the FSD pages into the NextJS `app` folder. This saves
the FSD project structure inside the `src` folder.
the FSD project structure inside the `src` folder. You should still also add the `pages` folder to the root, because the App router is compatible with the Pages router.

```sh
```
├── app # NextJS app folder
├── pages # Stub NextJS pages folder
│ ├── README.md # Description of why this folder exists
├── src
│ ├── app # FSD app folder
│ ├── entities
│ ├── features
│ ├── pages
│ ├── pages # FSD app folder
│ ├── shared
│ ├── widgets
```

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)][ext-app-router-stackblitz]

## See also {#see-also}

- [(Thread) About the pages directory in NextJS](https://t.me/feature_sliced/3623)

[project-knowledge]: /docs/about/understanding/knowledge-types
[ext-app-router-stackblitz]: https://stackblitz.com/edit/stackblitz-starters-aiez55?file=README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,26 @@ App Router стал стабильным в NextJS версии 13.4. App Router
для устранения конфликта с папкой `pages` NextJS.

Подход заключается в перемещении папки `app` NextJS в корневую папку проекта и импорте страниц FSD в папку `app` NextJS. Это сохраняет
структуру проекта FSD внутри папки `src`.
структуру проекта FSD внутри папки `src`. Вам также стоит добавить в корневую папку проекта папку `pages`, потому что App Router совместим с Pages Router.

```sh
```
├── app # Папка app (NextJS)
├── pages # Пустая папка pages (NextJS)
│ ├── README.md # Описание того, зачем нужна эта папка
├── src
│ ├── app # Папка app (FSD)
│ ├── entities
│ ├── features
│ ├── pages
│ ├── pages # Папка pages (FSD)
│ ├── shared
│ ├── widgets
```

[![Открыть в StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)][ext-app-router-stackblitz]

## См. также {#see-also}

- [(Тред) Про pages директорию в NextJS](https://t.me/feature_sliced/3623)

[project-knowledge]: /docs/about/understanding/knowledge-types
[ext-app-router-stackblitz]: https://stackblitz.com/edit/stackblitz-starters-aiez55?file=README.md

0 comments on commit da2b6e6

Please sign in to comment.