@intlayer/docs 8.5.2 → 8.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/ar/intlayer_with_react_router_v7.md +2 -4
- package/docs/ar/intlayer_with_react_router_v7_fs_routes.md +2 -4
- package/docs/ar/intlayer_with_svelte_kit.md +2 -2
- package/docs/ar/intlayer_with_tanstack+solid.md +0 -17
- package/docs/ar/intlayer_with_tanstack.md +0 -8
- package/docs/ar/intlayer_with_vite+lit.md +0 -1
- package/docs/ar/intlayer_with_vite+solid.md +0 -1
- package/docs/ar/intlayer_with_vite+svelte.md +1 -1
- package/docs/bn/intlayer_with_vite+lit.md +0 -1
- package/docs/cs/intlayer_with_vite+lit.md +0 -1
- package/docs/de/intlayer_with_react_router_v7.md +2 -4
- package/docs/de/intlayer_with_react_router_v7_fs_routes.md +1 -2
- package/docs/de/intlayer_with_svelte_kit.md +2 -2
- package/docs/de/intlayer_with_tanstack+solid.md +80 -21
- package/docs/de/intlayer_with_tanstack.md +96 -28
- package/docs/de/intlayer_with_vite+lit.md +0 -1
- package/docs/de/intlayer_with_vite+solid.md +0 -1
- package/docs/de/intlayer_with_vite+svelte.md +1 -1
- package/docs/en/intlayer_with_react_router_v7.md +1 -2
- package/docs/en/intlayer_with_react_router_v7_fs_routes.md +2 -4
- package/docs/en/intlayer_with_svelte_kit.md +2 -2
- package/docs/en/intlayer_with_tanstack+solid.md +81 -19
- package/docs/en/intlayer_with_tanstack.md +81 -10
- package/docs/en/intlayer_with_vite+lit.md +0 -1
- package/docs/en/intlayer_with_vite+solid.md +0 -1
- package/docs/en/intlayer_with_vite+svelte.md +5 -6
- package/docs/en-GB/intlayer_with_react_router_v7.md +2 -4
- package/docs/en-GB/intlayer_with_react_router_v7_fs_routes.md +2 -4
- package/docs/en-GB/intlayer_with_svelte_kit.md +2 -2
- package/docs/en-GB/intlayer_with_tanstack+solid.md +73 -17
- package/docs/en-GB/intlayer_with_tanstack.md +74 -9
- package/docs/en-GB/intlayer_with_vite+lit.md +0 -1
- package/docs/en-GB/intlayer_with_vite+solid.md +0 -1
- package/docs/en-GB/intlayer_with_vite+svelte.md +1 -1
- package/docs/es/intlayer_with_react_router_v7.md +2 -4
- package/docs/es/intlayer_with_react_router_v7_fs_routes.md +2 -4
- package/docs/es/intlayer_with_svelte_kit.md +2 -2
- package/docs/es/intlayer_with_tanstack+solid.md +80 -21
- package/docs/es/intlayer_with_tanstack.md +96 -28
- package/docs/es/intlayer_with_vite+lit.md +0 -1
- package/docs/es/intlayer_with_vite+solid.md +0 -1
- package/docs/es/intlayer_with_vite+svelte.md +1 -1
- package/docs/fr/intlayer_with_react_router_v7.md +2 -4
- package/docs/fr/intlayer_with_react_router_v7_fs_routes.md +2 -4
- package/docs/fr/intlayer_with_svelte_kit.md +3 -3
- package/docs/fr/intlayer_with_tanstack+solid.md +80 -21
- package/docs/fr/intlayer_with_tanstack.md +96 -28
- package/docs/fr/intlayer_with_vite+lit.md +0 -1
- package/docs/fr/intlayer_with_vite+solid.md +0 -1
- package/docs/fr/intlayer_with_vite+svelte.md +1 -1
- package/docs/hi/intlayer_with_react_router_v7.md +2 -4
- package/docs/hi/intlayer_with_react_router_v7_fs_routes.md +2 -4
- package/docs/hi/intlayer_with_svelte_kit.md +2 -2
- package/docs/hi/intlayer_with_tanstack+solid.md +0 -17
- package/docs/hi/intlayer_with_tanstack.md +0 -8
- package/docs/hi/intlayer_with_vite+lit.md +0 -1
- package/docs/hi/intlayer_with_vite+solid.md +0 -1
- package/docs/hi/intlayer_with_vite+svelte.md +1 -1
- package/docs/id/intlayer_with_react_router_v7.md +2 -4
- package/docs/id/intlayer_with_react_router_v7_fs_routes.md +2 -4
- package/docs/id/intlayer_with_svelte_kit.md +2 -2
- package/docs/id/intlayer_with_tanstack+solid.md +0 -17
- package/docs/id/intlayer_with_tanstack.md +0 -8
- package/docs/id/intlayer_with_vite+lit.md +0 -1
- package/docs/id/intlayer_with_vite+solid.md +0 -1
- package/docs/id/intlayer_with_vite+svelte.md +1 -1
- package/docs/it/intlayer_with_react_router_v7.md +2 -4
- package/docs/it/intlayer_with_react_router_v7_fs_routes.md +2 -4
- package/docs/it/intlayer_with_svelte_kit.md +3 -3
- package/docs/it/intlayer_with_tanstack+solid.md +78 -19
- package/docs/it/intlayer_with_tanstack.md +96 -30
- package/docs/it/intlayer_with_vite+lit.md +0 -1
- package/docs/it/intlayer_with_vite+solid.md +0 -1
- package/docs/it/intlayer_with_vite+svelte.md +1 -1
- package/docs/ja/intlayer_with_react_router_v7.md +1 -2
- package/docs/ja/intlayer_with_react_router_v7_fs_routes.md +2 -4
- package/docs/ja/intlayer_with_tanstack+solid.md +83 -22
- package/docs/ja/intlayer_with_tanstack.md +779 -93
- package/docs/ja/intlayer_with_vite+lit.md +0 -1
- package/docs/ja/intlayer_with_vite+solid.md +0 -1
- package/docs/ja/intlayer_with_vite+svelte.md +1 -1
- package/docs/ko/intlayer_with_react_router_v7.md +2 -4
- package/docs/ko/intlayer_with_react_router_v7_fs_routes.md +2 -4
- package/docs/ko/intlayer_with_svelte_kit.md +2 -2
- package/docs/ko/intlayer_with_tanstack+solid.md +81 -22
- package/docs/ko/intlayer_with_tanstack.md +95 -101
- package/docs/ko/intlayer_with_vite+lit.md +0 -1
- package/docs/ko/intlayer_with_vite+solid.md +0 -1
- package/docs/ko/intlayer_with_vite+svelte.md +1 -1
- package/docs/nl/intlayer_with_vite+lit.md +0 -1
- package/docs/pl/intlayer_with_react_router_v7.md +2 -4
- package/docs/pl/intlayer_with_react_router_v7_fs_routes.md +2 -4
- package/docs/pl/intlayer_with_svelte_kit.md +2 -2
- package/docs/pl/intlayer_with_tanstack+solid.md +0 -17
- package/docs/pl/intlayer_with_tanstack.md +0 -8
- package/docs/pl/intlayer_with_vite+lit.md +0 -1
- package/docs/pl/intlayer_with_vite+solid.md +0 -1
- package/docs/pl/intlayer_with_vite+svelte.md +1 -1
- package/docs/pt/intlayer_with_react_router_v7.md +1 -2
- package/docs/pt/intlayer_with_react_router_v7_fs_routes.md +2 -4
- package/docs/pt/intlayer_with_svelte_kit.md +3 -3
- package/docs/pt/intlayer_with_tanstack+solid.md +78 -19
- package/docs/pt/intlayer_with_tanstack.md +96 -30
- package/docs/pt/intlayer_with_vite+lit.md +0 -1
- package/docs/pt/intlayer_with_vite+solid.md +0 -1
- package/docs/pt/intlayer_with_vite+svelte.md +1 -1
- package/docs/ru/intlayer_with_react_router_v7.md +2 -4
- package/docs/ru/intlayer_with_react_router_v7_fs_routes.md +2 -4
- package/docs/ru/intlayer_with_svelte_kit.md +2 -2
- package/docs/ru/intlayer_with_tanstack+solid.md +80 -21
- package/docs/ru/intlayer_with_tanstack.md +99 -33
- package/docs/ru/intlayer_with_vite+lit.md +0 -1
- package/docs/ru/intlayer_with_vite+solid.md +0 -1
- package/docs/ru/intlayer_with_vite+svelte.md +1 -1
- package/docs/tr/intlayer_with_react_router_v7.md +2 -4
- package/docs/tr/intlayer_with_react_router_v7_fs_routes.md +2 -4
- package/docs/tr/intlayer_with_svelte_kit.md +2 -2
- package/docs/tr/intlayer_with_tanstack+solid.md +0 -17
- package/docs/tr/intlayer_with_tanstack.md +0 -8
- package/docs/tr/intlayer_with_vite+lit.md +0 -1
- package/docs/tr/intlayer_with_vite+solid.md +0 -1
- package/docs/tr/intlayer_with_vite+svelte.md +1 -1
- package/docs/uk/intlayer_with_react_router_v7.md +1 -2
- package/docs/uk/intlayer_with_react_router_v7_fs_routes.md +2 -4
- package/docs/uk/intlayer_with_svelte_kit.md +2 -2
- package/docs/uk/intlayer_with_tanstack+solid.md +0 -17
- package/docs/uk/intlayer_with_tanstack.md +0 -8
- package/docs/uk/intlayer_with_vite+lit.md +0 -1
- package/docs/uk/intlayer_with_vite+solid.md +0 -1
- package/docs/uk/intlayer_with_vite+svelte.md +1 -1
- package/docs/ur/intlayer_with_vite+lit.md +0 -1
- package/docs/vi/intlayer_with_react_router_v7.md +2 -4
- package/docs/vi/intlayer_with_react_router_v7_fs_routes.md +2 -4
- package/docs/vi/intlayer_with_svelte_kit.md +2 -2
- package/docs/vi/intlayer_with_tanstack+solid.md +0 -17
- package/docs/vi/intlayer_with_tanstack.md +0 -8
- package/docs/vi/intlayer_with_vite+lit.md +0 -1
- package/docs/vi/intlayer_with_vite+solid.md +0 -1
- package/docs/vi/intlayer_with_vite+svelte.md +1 -1
- package/docs/zh/intlayer_with_react_router_v7.md +2 -4
- package/docs/zh/intlayer_with_react_router_v7_fs_routes.md +2 -4
- package/docs/zh/intlayer_with_svelte_kit.md +2 -2
- package/docs/zh/intlayer_with_tanstack+solid.md +82 -23
- package/docs/zh/intlayer_with_tanstack.md +96 -104
- package/docs/zh/intlayer_with_vite+lit.md +0 -1
- package/docs/zh/intlayer_with_vite+solid.md +0 -1
- package/docs/zh/intlayer_with_vite+svelte.md +1 -1
- package/package.json +8 -8
|
@@ -372,7 +372,7 @@ export default heroContent;
|
|
|
372
372
|
<!-- Renderuj treść jako prostą zawartość -->
|
|
373
373
|
<h1>{$content.title}</h1>
|
|
374
374
|
<!-- Aby renderować treść edytowalną za pomocą edytora -->
|
|
375
|
-
<h1
|
|
375
|
+
<h1>{@const Title = $content.title}<Title /></h1>
|
|
376
376
|
<!-- Aby wyrenderować zawartość jako ciąg znaków -->
|
|
377
377
|
<div aria-label={$content.title.value}></div>
|
|
378
378
|
```
|
|
@@ -728,7 +728,7 @@ Aby móc wizualizować selektor edytora intlayer, musisz użyć składni kompone
|
|
|
728
728
|
<h1>{$content.title}</h1>
|
|
729
729
|
|
|
730
730
|
<!-- Renderuj zawartość jako komponent (wymagane przez edytor) -->
|
|
731
|
-
|
|
731
|
+
{@const Component = $content.component}<Component />
|
|
732
732
|
</div>
|
|
733
733
|
```
|
|
734
734
|
|
|
@@ -140,16 +140,12 @@ Dodaj wtyczkę intlayer do swojej konfiguracji:
|
|
|
140
140
|
import { intlayer } from "vite-intlayer";
|
|
141
141
|
import { defineConfig } from "vite";
|
|
142
142
|
import { devtools } from "@tanstack/devtools-vite";
|
|
143
|
-
import viteTsConfigPaths from "vite-tsconfig-paths";
|
|
144
143
|
import { tanstackStart } from "@tanstack/solid-start/plugin/vite";
|
|
145
144
|
import solidPlugin from "vite-plugin-solid";
|
|
146
145
|
|
|
147
146
|
export default defineConfig({
|
|
148
147
|
plugins: [
|
|
149
148
|
devtools(),
|
|
150
|
-
viteTsConfigPaths({
|
|
151
|
-
projects: ["./tsconfig.json"],
|
|
152
|
-
}),
|
|
153
149
|
tanstackStart({
|
|
154
150
|
router: {
|
|
155
151
|
routeFileIgnorePattern:
|
|
@@ -221,9 +217,6 @@ function RootComponent() {
|
|
|
221
217
|
}
|
|
222
218
|
```
|
|
223
219
|
|
|
224
|
-
> [!NOTE]
|
|
225
|
-
> W plikach Solid, `useMatches` zwraca **signal** (reaktywny akcesor). Użyj `matches()` (z nawiasami), aby reaktywnie uzyskać dostęp do aktualnej wartości.
|
|
226
|
-
|
|
227
220
|
### Krok 6: Utworzenie Layoutu Językowego (opcjonalnie)
|
|
228
221
|
|
|
229
222
|
Utwórz layout, który obsługuje prefiks językowy i wykonuje walidację. Ten layout zapewni, że przetwarzane będą tylko prawidłowe języki.
|
|
@@ -415,7 +408,6 @@ function RouteComponent() {
|
|
|
415
408
|
}
|
|
416
409
|
```
|
|
417
410
|
|
|
418
|
-
> [!NOTE]
|
|
419
411
|
> W Solidzie, `useIntlayer` zwraca funkcję **accessor** (np.: `content()`). Musisz wywołać tę funkcję, aby uzyskać dostęp do reaktywnej treści.
|
|
420
412
|
>
|
|
421
413
|
> Aby dowiedzieć się więcej o hooku `useIntlayer`, zapoznaj się z [dokumentacją](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pl/packages/solid-intlayer/useIntlayer.md).
|
|
@@ -460,7 +452,6 @@ export const LocaleSwitcher = () => {
|
|
|
460
452
|
export default LocaleSwitcher;
|
|
461
453
|
```
|
|
462
454
|
|
|
463
|
-
> [!NOTE]
|
|
464
455
|
> W plikach Solid, `locale` z `useLocale` to **signal accessor**. Użyj `locale()` (z nawiasami), aby reaktywnie odczytać jego aktualną wartość.
|
|
465
456
|
>
|
|
466
457
|
> Aby dowiedzieć się więcej o hooku `useLocale`, zapoznaj się z [dokumentacją](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pl/packages/solid-intlayer/useLocale.md).
|
|
@@ -502,15 +493,11 @@ import solid from "vite-plugin-solid";
|
|
|
502
493
|
import { nitro } from "nitro/vite";
|
|
503
494
|
import { defineConfig } from "vite";
|
|
504
495
|
import { intlayer, intlayerProxy } from "vite-intlayer";
|
|
505
|
-
import viteTsConfigPaths from "vite-tsconfig-paths";
|
|
506
496
|
|
|
507
497
|
export default defineConfig({
|
|
508
498
|
plugins: [
|
|
509
499
|
intlayerProxy(), // Proxy powinno być umieszczone przed serwerem, jeśli używasz Nitro
|
|
510
500
|
nitro(),
|
|
511
|
-
viteTsConfigPaths({
|
|
512
|
-
projects: ["./tsconfig.json"],
|
|
513
|
-
}),
|
|
514
501
|
intlayer(),
|
|
515
502
|
tanstackStart({
|
|
516
503
|
router: {
|
|
@@ -803,16 +790,12 @@ Zaktualizuj swoje `vite.config.ts`, aby dołączyć wtyczkę `intlayerCompiler`:
|
|
|
803
790
|
import { intlayer, intlayerCompiler } from "vite-intlayer";
|
|
804
791
|
import { defineConfig } from "vite";
|
|
805
792
|
import { devtools } from "@tanstack/devtools-vite";
|
|
806
|
-
import viteTsConfigPaths from "vite-tsconfig-paths";
|
|
807
793
|
import { tanstackStart } from "@tanstack/solid-start/plugin/vite";
|
|
808
794
|
import solidPlugin from "vite-plugin-solid";
|
|
809
795
|
|
|
810
796
|
export default defineConfig({
|
|
811
797
|
plugins: [
|
|
812
798
|
devtools(),
|
|
813
|
-
viteTsConfigPaths({
|
|
814
|
-
projects: ["./tsconfig.json"],
|
|
815
|
-
}),
|
|
816
799
|
tanstackStart({
|
|
817
800
|
router: {
|
|
818
801
|
routeFileIgnorePattern:
|
|
@@ -160,14 +160,10 @@ import viteReact from "@vitejs/plugin-react";
|
|
|
160
160
|
import { nitro } from "nitro/vite";
|
|
161
161
|
import { defineConfig } from "vite";
|
|
162
162
|
import { intlayer } from "vite-intlayer";
|
|
163
|
-
import viteTsConfigPaths from "vite-tsconfig-paths";
|
|
164
163
|
|
|
165
164
|
const config = defineConfig({
|
|
166
165
|
plugins: [
|
|
167
166
|
nitro(),
|
|
168
|
-
viteTsConfigPaths({
|
|
169
|
-
projects: ["./tsconfig.json"],
|
|
170
|
-
}),
|
|
171
167
|
intlayer(),
|
|
172
168
|
tanstackStart({
|
|
173
169
|
router: {
|
|
@@ -593,15 +589,11 @@ import viteReact from "@vitejs/plugin-react";
|
|
|
593
589
|
import { nitro } from "nitro/vite";
|
|
594
590
|
import { defineConfig } from "vite";
|
|
595
591
|
import { intlayer, intlayerProxy } from "vite-intlayer";
|
|
596
|
-
import viteTsConfigPaths from "vite-tsconfig-paths";
|
|
597
592
|
|
|
598
593
|
export default defineConfig({
|
|
599
594
|
plugins: [
|
|
600
595
|
intlayerProxy(), // Proxy powinno być umieszczone przed serwerem, jeśli używasz Nitro
|
|
601
596
|
nitro(),
|
|
602
|
-
viteTsConfigPaths({
|
|
603
|
-
projects: ["./tsconfig.json"],
|
|
604
|
-
}),
|
|
605
597
|
intlayer(),
|
|
606
598
|
tanstackStart({
|
|
607
599
|
router: {
|
|
@@ -409,7 +409,6 @@ export class MyElement extends LitElement {
|
|
|
409
409
|
}
|
|
410
410
|
```
|
|
411
411
|
|
|
412
|
-
> [!NOTE]
|
|
413
412
|
> Gdy potrzebujesz przetłumaczonego ciągu znaków w natywnym atrybucie HTML (np. `alt`, `aria-label`, `title`), wywołaj `.value` na węźle typu liść (leaf node):
|
|
414
413
|
>
|
|
415
414
|
> ```typescript
|
|
@@ -314,7 +314,6 @@ const App: Component = () => (
|
|
|
314
314
|
export default App;
|
|
315
315
|
```
|
|
316
316
|
|
|
317
|
-
> [!NOTE]
|
|
318
317
|
> W Solid, `useIntlayer` zwraca funkcję **accessor** (np. `content()`). Musisz wywołać tę funkcję, aby uzyskać dostęp do reaktywnej zawartości.
|
|
319
318
|
|
|
320
319
|
> Jeśli chcesz użyć swojej zawartości w atrybucie `string`, takim jak `alt`, `title`, `href`, `aria-label` itp., musisz wywołać wartość funkcji, jak:
|
|
@@ -233,7 +233,7 @@ module.exports = appContent;
|
|
|
233
233
|
<!-- Renderuj zawartość jako prostą zawartość -->
|
|
234
234
|
<h1>{$content.title}</h1>
|
|
235
235
|
<!-- Aby renderować zawartość edytowalną za pomocą edytora -->
|
|
236
|
-
<h1
|
|
236
|
+
<h1>{@const Title = $content.title}<Title /></h1>
|
|
237
237
|
<!-- Aby renderować zawartość jako ciąg znaków -->
|
|
238
238
|
<div aria-label={$content.title.value}></div>
|
|
239
239
|
```
|
|
@@ -195,13 +195,12 @@ Adicione o plugin intlayer na sua configuração:
|
|
|
195
195
|
import { reactRouter } from "@react-router/dev/vite";
|
|
196
196
|
import { defineConfig } from "vite";
|
|
197
197
|
import { intlayerProxy, intlayer } from "vite-intlayer";
|
|
198
|
-
import tsconfigPaths from "vite-tsconfig-paths";
|
|
199
198
|
|
|
200
199
|
export default defineConfig({
|
|
201
200
|
plugins: [
|
|
202
201
|
intlayerProxy(), // should be placed first
|
|
203
202
|
reactRouter(),
|
|
204
|
-
|
|
203
|
+
|
|
205
204
|
intlayer(),
|
|
206
205
|
],
|
|
207
206
|
});
|
|
@@ -169,10 +169,9 @@ Adicione o plugin intlayer na sua configuração:
|
|
|
169
169
|
import { reactRouter } from "@react-router/dev/vite";
|
|
170
170
|
import { defineConfig } from "vite";
|
|
171
171
|
import { intlayer } from "vite-intlayer";
|
|
172
|
-
import tsconfigPaths from "vite-tsconfig-paths";
|
|
173
172
|
|
|
174
173
|
export default defineConfig({
|
|
175
|
-
plugins: [reactRouter(),
|
|
174
|
+
plugins: [reactRouter(), intlayer()],
|
|
176
175
|
});
|
|
177
176
|
```
|
|
178
177
|
|
|
@@ -803,13 +802,12 @@ Você também pode usar o `intlayerProxy` para adicionar roteamento do lado do s
|
|
|
803
802
|
import { reactRouter } from "@react-router/dev/vite";
|
|
804
803
|
import { defineConfig } from "vite";
|
|
805
804
|
import { intlayer, intlayerProxy } from "vite-intlayer";
|
|
806
|
-
import tsconfigPaths from "vite-tsconfig-paths";
|
|
807
805
|
|
|
808
806
|
export default defineConfig({
|
|
809
807
|
plugins: [
|
|
810
808
|
intlayerProxy(), // should be placed first
|
|
811
809
|
reactRouter(),
|
|
812
|
-
|
|
810
|
+
|
|
813
811
|
intlayer(),
|
|
814
812
|
],
|
|
815
813
|
});
|
|
@@ -372,7 +372,7 @@ para acessar seu valor reativo (por exemplo, `$content.title`).
|
|
|
372
372
|
<!-- Renderizar conteúdo como conteúdo simples -->
|
|
373
373
|
<h1>{$content.title}</h1>
|
|
374
374
|
<!-- Para renderizar o conteúdo editável usando o editor -->
|
|
375
|
-
<h1
|
|
375
|
+
<h1>{@const Title = $content.title}<Title /></h1>
|
|
376
376
|
<!-- Para renderizar o conteúdo como uma string -->
|
|
377
377
|
<div aria-label={$content.title.value}></div>
|
|
378
378
|
```
|
|
@@ -728,7 +728,7 @@ Para poder visualizar o seletor do editor intlayer, você deverá usar a sintaxe
|
|
|
728
728
|
<h1>{$content.title}</h1>
|
|
729
729
|
|
|
730
730
|
<!-- Renderizar conteúdo como um componente (requerido pelo editor) -->
|
|
731
|
-
|
|
731
|
+
{@const Component = $content.component}<Component />
|
|
732
732
|
</div>
|
|
733
733
|
```
|
|
734
734
|
|
|
@@ -760,7 +760,7 @@ Para poder visualizar o seletor do editor intlayer, você terá que usar a sinta
|
|
|
760
760
|
<h1>{$content.title}</h1>
|
|
761
761
|
|
|
762
762
|
<!-- Renderizar conteúdo como um componente (requerido pelo editor) -->
|
|
763
|
-
|
|
763
|
+
{@const Component = $content.component}<Component />
|
|
764
764
|
</div>
|
|
765
765
|
```
|
|
766
766
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-03-25
|
|
3
|
-
updatedAt: 2026-03-
|
|
3
|
+
updatedAt: 2026-03-29
|
|
4
4
|
title: i18n Tanstack Start - Como traduzir uma aplicação Tanstack Start usando Solid.js em 2026
|
|
5
5
|
description: Aprenda como adicionar internacionalização (i18n) à sua aplicação Tanstack Start usando Intlayer e Solid.js. Siga este guia completo para tornar sua aplicação multilíngue com roteamento ciente de localidade.
|
|
6
6
|
keywords:
|
|
@@ -12,6 +12,7 @@ keywords:
|
|
|
12
12
|
- i18n
|
|
13
13
|
- TypeScript
|
|
14
14
|
- Roteamento de Localidade
|
|
15
|
+
- Sitemap
|
|
15
16
|
slugs:
|
|
16
17
|
- doc
|
|
17
18
|
- environment
|
|
@@ -140,16 +141,12 @@ Adicione o plugin intlayer na sua configuração:
|
|
|
140
141
|
import { intlayer } from "vite-intlayer";
|
|
141
142
|
import { defineConfig } from "vite";
|
|
142
143
|
import { devtools } from "@tanstack/devtools-vite";
|
|
143
|
-
import viteTsConfigPaths from "vite-tsconfig-paths";
|
|
144
144
|
import { tanstackStart } from "@tanstack/solid-start/plugin/vite";
|
|
145
145
|
import solidPlugin from "vite-plugin-solid";
|
|
146
146
|
|
|
147
147
|
export default defineConfig({
|
|
148
148
|
plugins: [
|
|
149
149
|
devtools(),
|
|
150
|
-
viteTsConfigPaths({
|
|
151
|
-
projects: ["./tsconfig.json"],
|
|
152
|
-
}),
|
|
153
150
|
tanstackStart({
|
|
154
151
|
router: {
|
|
155
152
|
routeFileIgnorePattern:
|
|
@@ -221,9 +218,6 @@ function RootComponent() {
|
|
|
221
218
|
}
|
|
222
219
|
```
|
|
223
220
|
|
|
224
|
-
> [!NOTE]
|
|
225
|
-
> No Solid, `useMatches` retorna um **signal** (acessador reativo). Use `matches()` (com parênteses) para acessar o valor atual de forma reativa.
|
|
226
|
-
|
|
227
221
|
### Passo 6: Criar o Layout de Localidade (Opcional)
|
|
228
222
|
|
|
229
223
|
Crie um layout que lide com o prefixo de localidade e realize a validação. Este layout garantirá que apenas localidades válidas sejam processadas.
|
|
@@ -415,7 +409,6 @@ function RouteComponent() {
|
|
|
415
409
|
}
|
|
416
410
|
```
|
|
417
411
|
|
|
418
|
-
> [!NOTE]
|
|
419
412
|
> No Solid, `useIntlayer` retorna uma função **accessor** (ex: `content()`). Você deve chamar esta função para acessar o conteúdo reativo.
|
|
420
413
|
>
|
|
421
414
|
> Para aprender mais sobre o hook `useIntlayer`, consulte a [documentação](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/packages/solid-intlayer/useIntlayer.md).
|
|
@@ -460,7 +453,6 @@ export const LocaleSwitcher = () => {
|
|
|
460
453
|
export default LocaleSwitcher;
|
|
461
454
|
```
|
|
462
455
|
|
|
463
|
-
> [!NOTE]
|
|
464
456
|
> No Solid, `locale` de `useLocale` é um **signal accessor**. Use `locale()` (com parênteses) para ler o seu valor atual de forma reativa.
|
|
465
457
|
>
|
|
466
458
|
> Para aprender mais sobre o hook `useLocale`, consulte la [documentação](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/packages/solid-intlayer/useLocale.md).
|
|
@@ -502,15 +494,11 @@ import solid from "vite-plugin-solid";
|
|
|
502
494
|
import { nitro } from "nitro/vite";
|
|
503
495
|
import { defineConfig } from "vite";
|
|
504
496
|
import { intlayer, intlayerProxy } from "vite-intlayer";
|
|
505
|
-
import viteTsConfigPaths from "vite-tsconfig-paths";
|
|
506
497
|
|
|
507
498
|
export default defineConfig({
|
|
508
499
|
plugins: [
|
|
509
500
|
intlayerProxy(), // O proxy deve ser colocado antes do servidor se você usar o Nitro
|
|
510
501
|
nitro(),
|
|
511
|
-
viteTsConfigPaths({
|
|
512
|
-
projects: ["./tsconfig.json"],
|
|
513
|
-
}),
|
|
514
502
|
intlayer(),
|
|
515
503
|
tanstackStart({
|
|
516
504
|
router: {
|
|
@@ -662,7 +650,7 @@ export const Route = createFileRoute("/{-$locale}/$")({
|
|
|
662
650
|
});
|
|
663
651
|
```
|
|
664
652
|
|
|
665
|
-
### (Opcional) Passo
|
|
653
|
+
### (Opcional) Passo 15: Extrair o conteúdo dos seus componentes
|
|
666
654
|
|
|
667
655
|
Se você tem uma base de código existente, transformar milhares de arquivos pode ser demorado.
|
|
668
656
|
|
|
@@ -803,16 +791,12 @@ Atualize o seu `vite.config.ts` para incluir o plugin `intlayerCompiler`:
|
|
|
803
791
|
import { intlayer, intlayerCompiler } from "vite-intlayer";
|
|
804
792
|
import { defineConfig } from "vite";
|
|
805
793
|
import { devtools } from "@tanstack/devtools-vite";
|
|
806
|
-
import viteTsConfigPaths from "vite-tsconfig-paths";
|
|
807
794
|
import { tanstackStart } from "@tanstack/solid-start/plugin/vite";
|
|
808
795
|
import solidPlugin from "vite-plugin-solid";
|
|
809
796
|
|
|
810
797
|
export default defineConfig({
|
|
811
798
|
plugins: [
|
|
812
799
|
devtools(),
|
|
813
|
-
viteTsConfigPaths({
|
|
814
|
-
projects: ["./tsconfig.json"],
|
|
815
|
-
}),
|
|
816
800
|
tanstackStart({
|
|
817
801
|
router: {
|
|
818
802
|
routeFileIgnorePattern:
|
|
@@ -847,6 +831,81 @@ bun run build # Ou bun run dev
|
|
|
847
831
|
|
|
848
832
|
---
|
|
849
833
|
|
|
834
|
+
### Passo 16: Gerar um Sitemap (Opcional)
|
|
835
|
+
|
|
836
|
+
O Intlayer vem com um gerador de sitemap integrado para ajudá-lo a criar facilmente um sitemap para sua aplicação. Ele cuida das rotas localizadas e adiciona os metadados necessários para os mecanismos de busca.
|
|
837
|
+
|
|
838
|
+
> O sitemap gerado pelo Intlayer suporta o namespace `xhtml:link` (Hreflang XML Extensions). Ao contrário dos geradores de sitemap padrão que apenas listam URLs brutos, o Intlayer cria automaticamente os links bidirecionais necessários entre todas as versões de idioma de uma página (por exemplo, `/about`, `/about?lang=fr` e `/about?lang=es`). Isso garante que os mecanismos de busca indexem e sirvam corretamente a versão de idioma certa para o público certo.
|
|
839
|
+
|
|
840
|
+
Para usá-lo, você primeiro precisa configurar o seu `vite.config.ts` para habilitar a pré-renderização de suas rotas localizadas e desabilitar a geração de sitemap padrão do TanStack Start.
|
|
841
|
+
|
|
842
|
+
```typescript fileName="vite.config.ts"
|
|
843
|
+
import { localeMap, localeFlatMap } from "intlayer";
|
|
844
|
+
// ... outras importações
|
|
845
|
+
|
|
846
|
+
export const pathList = ["", "/about", "/404"];
|
|
847
|
+
|
|
848
|
+
const localizedPages = localeFlatMap(({ urlPrefix }) =>
|
|
849
|
+
pathList.map((path) => ({
|
|
850
|
+
path: `${urlPrefix}${path}`,
|
|
851
|
+
prerender: {
|
|
852
|
+
enabled: true,
|
|
853
|
+
},
|
|
854
|
+
}))
|
|
855
|
+
);
|
|
856
|
+
|
|
857
|
+
export default defineConfig({
|
|
858
|
+
plugins: [
|
|
859
|
+
// ... outros plugins
|
|
860
|
+
tanstackStart({
|
|
861
|
+
// ... outras configurações
|
|
862
|
+
sitemap: {
|
|
863
|
+
enabled: false,
|
|
864
|
+
},
|
|
865
|
+
prerender: {
|
|
866
|
+
enabled: true,
|
|
867
|
+
crawlLinks: false,
|
|
868
|
+
concurrency: 10,
|
|
869
|
+
},
|
|
870
|
+
pages: localizedPages,
|
|
871
|
+
}),
|
|
872
|
+
],
|
|
873
|
+
});
|
|
874
|
+
```
|
|
875
|
+
|
|
876
|
+
Em seguida, crie uma rota `src/routes/sitemap[.]xml.ts` que use a função `generateSitemap`:
|
|
877
|
+
|
|
878
|
+
```typescript fileName="src/routes/sitemap[.]xml.ts"
|
|
879
|
+
import { createFileRoute } from "@tanstack/solid-router";
|
|
880
|
+
import { generateSitemap } from "intlayer";
|
|
881
|
+
|
|
882
|
+
const SITE_URL = (
|
|
883
|
+
import.meta.env.VITE_SITE_URL ?? "http://localhost:3000"
|
|
884
|
+
).replace(/\/$/, "");
|
|
885
|
+
|
|
886
|
+
export const Route = createFileRoute("/sitemap.xml")({
|
|
887
|
+
server: {
|
|
888
|
+
handlers: {
|
|
889
|
+
GET: async () => {
|
|
890
|
+
const sitemap = generateSitemap(
|
|
891
|
+
[
|
|
892
|
+
{ path: "/", changefreq: "daily", priority: 1.0 },
|
|
893
|
+
{ path: "/about", changefreq: "monthly", priority: 0.8 },
|
|
894
|
+
],
|
|
895
|
+
{ siteUrl: SITE_URL }
|
|
896
|
+
);
|
|
897
|
+
|
|
898
|
+
return new Response(sitemap, {
|
|
899
|
+
headers: { "Content-Type": "application/xml" },
|
|
900
|
+
});
|
|
901
|
+
},
|
|
902
|
+
},
|
|
903
|
+
},
|
|
904
|
+
});
|
|
905
|
+
```
|
|
906
|
+
|
|
907
|
+
---
|
|
908
|
+
|
|
850
909
|
### Passo 17: Configurar TypeScript (Opcional)
|
|
851
910
|
|
|
852
911
|
O Intlayer usa a ampliação de módulo para obter os benefícios do TypeScript e tornar a sua base de código mais forte.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-09-09
|
|
3
|
-
updatedAt: 2026-03-
|
|
3
|
+
updatedAt: 2026-03-29
|
|
4
4
|
title: Tanstack Start i18n - Como traduzir uma aplicação Tanstack Start em 2026
|
|
5
5
|
description: Aprenda como adicionar internacionalização (i18n) à sua aplicação Tanstack Start usando Intlayer. Siga este guia completo para tornar seu app multilíngue com roteamento sensível ao locale.
|
|
6
6
|
keywords:
|
|
@@ -12,6 +12,7 @@ keywords:
|
|
|
12
12
|
- i18n
|
|
13
13
|
- TypeScript
|
|
14
14
|
- Roteamento por Locale
|
|
15
|
+
- Sitemap
|
|
15
16
|
slugs:
|
|
16
17
|
- doc
|
|
17
18
|
- environment
|
|
@@ -160,14 +161,10 @@ import viteReact from "@vitejs/plugin-react";
|
|
|
160
161
|
import { nitro } from "nitro/vite";
|
|
161
162
|
import { defineConfig } from "vite";
|
|
162
163
|
import { intlayer } from "vite-intlayer";
|
|
163
|
-
import viteTsConfigPaths from "vite-tsconfig-paths";
|
|
164
164
|
|
|
165
165
|
const config = defineConfig({
|
|
166
166
|
plugins: [
|
|
167
167
|
nitro(),
|
|
168
|
-
viteTsConfigPaths({
|
|
169
|
-
projects: ["./tsconfig.json"],
|
|
170
|
-
}),
|
|
171
168
|
intlayer(),
|
|
172
169
|
tanstackStart({
|
|
173
170
|
router: {
|
|
@@ -594,15 +591,11 @@ import viteReact from "@vitejs/plugin-react";
|
|
|
594
591
|
import { nitro } from "nitro/vite";
|
|
595
592
|
import { defineConfig } from "vite";
|
|
596
593
|
import { intlayer, intlayerProxy } from "vite-intlayer";
|
|
597
|
-
import viteTsConfigPaths from "vite-tsconfig-paths";
|
|
598
594
|
|
|
599
595
|
export default defineConfig({
|
|
600
596
|
plugins: [
|
|
601
597
|
intlayerProxy(), // O proxy deve ser colocado antes do servidor se você usar Nitro
|
|
602
598
|
nitro(),
|
|
603
|
-
viteTsConfigPaths({
|
|
604
|
-
projects: ["./tsconfig.json"],
|
|
605
|
-
}),
|
|
606
599
|
intlayer(),
|
|
607
600
|
tanstackStart({
|
|
608
601
|
router: {
|
|
@@ -754,27 +747,7 @@ export const Route = createFileRoute("/{-$locale}/$")({
|
|
|
754
747
|
});
|
|
755
748
|
```
|
|
756
749
|
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
### Passo 16: Configurar TypeScript (Opcional)
|
|
760
|
-
|
|
761
|
-
O Intlayer utiliza a ampliação de módulos para aproveitar os benefícios do TypeScript e fortalecer sua base de código.
|
|
762
|
-
|
|
763
|
-
Certifique-se de que sua configuração do TypeScript inclua os tipos gerados automaticamente:
|
|
764
|
-
|
|
765
|
-
```json5 fileName="tsconfig.json"
|
|
766
|
-
{
|
|
767
|
-
// ... suas configurações existentes
|
|
768
|
-
include: [
|
|
769
|
-
// ... seus includes existentes
|
|
770
|
-
".intlayer/**/*.ts", // Incluir os tipos gerados automaticamente
|
|
771
|
-
],
|
|
772
|
-
}
|
|
773
|
-
```
|
|
774
|
-
|
|
775
|
-
---
|
|
776
|
-
|
|
777
|
-
### (Opcional) Etapa 1 : Extrair o conteúdo dos seus componentes
|
|
750
|
+
### (Opcional) Passo 15: Extrair o conteúdo dos seus componentes
|
|
778
751
|
|
|
779
752
|
Se você tiver uma base de código existente, transformar milhares de arquivos pode ser demorado.
|
|
780
753
|
|
|
@@ -932,6 +905,99 @@ bun run build # Or bun run dev
|
|
|
932
905
|
|
|
933
906
|
---
|
|
934
907
|
|
|
908
|
+
### Passo 16: Gerar um Sitemap (Opcional)
|
|
909
|
+
|
|
910
|
+
O Intlayer vem com um gerador de sitemap integrado para ajudá-lo a criar facilmente um sitemap para sua aplicação. Ele cuida das rotas localizadas e adiciona os metadados necessários para os mecanismos de busca.
|
|
911
|
+
|
|
912
|
+
> O sitemap gerado pelo Intlayer suporta o namespace `xhtml:link` (Hreflang XML Extensions). Ao contrário dos geradores de sitemap padrão que apenas listam URLs brutos, o Intlayer cria automaticamente os links bidirecionais necessários entre todas as versões de idioma de uma página (por exemplo, `/about`, `/about?lang=fr` e `/about?lang=es`). Isso garante que os mecanismos de busca indexem e sirvam corretamente a versão de idioma certa para o público certo.
|
|
913
|
+
|
|
914
|
+
Para usá-lo, você primeiro precisa configurar o seu `vite.config.ts` para habilitar a pré-renderização de suas rotas localizadas e desabilitar a geração de sitemap padrão do TanStack Start.
|
|
915
|
+
|
|
916
|
+
```typescript fileName="vite.config.ts"
|
|
917
|
+
import { localeFlatMap } from "intlayer";
|
|
918
|
+
// ... outras importações
|
|
919
|
+
|
|
920
|
+
export const pathList = ["", "/about", "/404"];
|
|
921
|
+
|
|
922
|
+
const localizedPages = localeFlatMap(({ urlPrefix }) =>
|
|
923
|
+
pathList.map((path) => ({
|
|
924
|
+
path: `${urlPrefix}${path}`,
|
|
925
|
+
prerender: {
|
|
926
|
+
enabled: true,
|
|
927
|
+
},
|
|
928
|
+
}))
|
|
929
|
+
);
|
|
930
|
+
|
|
931
|
+
export default defineConfig({
|
|
932
|
+
plugins: [
|
|
933
|
+
// ... outros plugins
|
|
934
|
+
tanstackStart({
|
|
935
|
+
// ... outras configurações
|
|
936
|
+
sitemap: {
|
|
937
|
+
enabled: false,
|
|
938
|
+
},
|
|
939
|
+
prerender: {
|
|
940
|
+
enabled: true,
|
|
941
|
+
crawlLinks: false,
|
|
942
|
+
concurrency: 10,
|
|
943
|
+
},
|
|
944
|
+
pages: localizedPages,
|
|
945
|
+
}),
|
|
946
|
+
],
|
|
947
|
+
});
|
|
948
|
+
```
|
|
949
|
+
|
|
950
|
+
Em seguida, crie uma rota `src/routes/sitemap[.]xml.ts` que use a função `generateSitemap`:
|
|
951
|
+
|
|
952
|
+
```typescript fileName="src/routes/sitemap[.]xml.ts"
|
|
953
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
954
|
+
import { generateSitemap } from "intlayer";
|
|
955
|
+
|
|
956
|
+
const SITE_URL = (
|
|
957
|
+
import.meta.env.VITE_SITE_URL ?? "http://localhost:3000"
|
|
958
|
+
).replace(/\/$/, "");
|
|
959
|
+
|
|
960
|
+
export const Route = createFileRoute("/sitemap.xml")({
|
|
961
|
+
server: {
|
|
962
|
+
handlers: {
|
|
963
|
+
GET: async () => {
|
|
964
|
+
const sitemap = generateSitemap(
|
|
965
|
+
[
|
|
966
|
+
{ path: "/", changefreq: "daily", priority: 1.0 },
|
|
967
|
+
{ path: "/about", changefreq: "monthly", priority: 0.8 },
|
|
968
|
+
],
|
|
969
|
+
{ siteUrl: SITE_URL }
|
|
970
|
+
);
|
|
971
|
+
|
|
972
|
+
return new Response(sitemap, {
|
|
973
|
+
headers: { "Content-Type": "application/xml" },
|
|
974
|
+
});
|
|
975
|
+
},
|
|
976
|
+
},
|
|
977
|
+
},
|
|
978
|
+
});
|
|
979
|
+
```
|
|
980
|
+
|
|
981
|
+
---
|
|
982
|
+
|
|
983
|
+
### Passo 17: Configurar TypeScript (Opcional)
|
|
984
|
+
|
|
985
|
+
O Intlayer utiliza a ampliação de módulos para aproveitar os benefícios do TypeScript e fortalecer sua base de código.
|
|
986
|
+
|
|
987
|
+
Certifique-se de que sua configuração do TypeScript inclua os tipos gerados automaticamente:
|
|
988
|
+
|
|
989
|
+
```json5 fileName="tsconfig.json"
|
|
990
|
+
{
|
|
991
|
+
// ... suas configurações existentes
|
|
992
|
+
include: [
|
|
993
|
+
// ... seus includes existentes
|
|
994
|
+
".intlayer/**/*.ts", // Incluir os tipos gerados automaticamente
|
|
995
|
+
],
|
|
996
|
+
}
|
|
997
|
+
```
|
|
998
|
+
|
|
999
|
+
---
|
|
1000
|
+
|
|
935
1001
|
### Configuração do Git
|
|
936
1002
|
|
|
937
1003
|
É recomendado ignorar os arquivos gerados pelo Intlayer. Isso permite evitar que eles sejam comitados no seu repositório Git.
|
|
@@ -312,7 +312,6 @@ const App: Component = () => (
|
|
|
312
312
|
export default App;
|
|
313
313
|
```
|
|
314
314
|
|
|
315
|
-
> [!NOTE]
|
|
316
315
|
> No Solid, `useIntlayer` retorna uma função **accessor** (por exemplo, `content()`). Deve chamar esta função para aceder ao conteúdo reativo.
|
|
317
316
|
|
|
318
317
|
> Se quiser usar o seu conteúdo num atributo `string`, como `alt`, `title`, `href`, `aria-label`, etc., deve chamar o valor da função, como:
|
|
@@ -232,7 +232,7 @@ module.exports = appContent;
|
|
|
232
232
|
<!-- Renderizar conteúdo como conteúdo simples -->
|
|
233
233
|
<h1>{$content.title}</h1>
|
|
234
234
|
<!-- Para renderizar o conteúdo editável usando o editor -->
|
|
235
|
-
<h1
|
|
235
|
+
<h1>{@const Title = $content.title}<Title /></h1>
|
|
236
236
|
<!-- Para renderizar o conteúdo como uma string -->
|
|
237
237
|
<div aria-label={$content.title.value}></div>
|
|
238
238
|
|
|
@@ -174,10 +174,9 @@ module.exports = config;
|
|
|
174
174
|
import { reactRouter } from "@react-router/dev/vite";
|
|
175
175
|
import { defineConfig } from "vite";
|
|
176
176
|
import { intlayer } from "vite-intlayer";
|
|
177
|
-
import tsconfigPaths from "vite-tsconfig-paths";
|
|
178
177
|
|
|
179
178
|
export default defineConfig({
|
|
180
|
-
plugins: [reactRouter(),
|
|
179
|
+
plugins: [reactRouter(), intlayer()],
|
|
181
180
|
});
|
|
182
181
|
```
|
|
183
182
|
|
|
@@ -739,13 +738,12 @@ This comprehensive guide provides everything you need to integrate Intlayer with
|
|
|
739
738
|
import { reactRouter } from "@react-router/dev/vite";
|
|
740
739
|
import { defineConfig } from "vite";
|
|
741
740
|
import { intlayer, intlayerProxy } from "vite-intlayer";
|
|
742
|
-
import tsconfigPaths from "vite-tsconfig-paths";
|
|
743
741
|
|
|
744
742
|
export default defineConfig({
|
|
745
743
|
plugins: [
|
|
746
744
|
intlayerProxy(), // should be placed first
|
|
747
745
|
reactRouter(),
|
|
748
|
-
|
|
746
|
+
|
|
749
747
|
intlayer(),
|
|
750
748
|
],
|
|
751
749
|
});
|
|
@@ -169,10 +169,9 @@ module.exports = config;
|
|
|
169
169
|
import { reactRouter } from "@react-router/dev/vite";
|
|
170
170
|
import { defineConfig } from "vite";
|
|
171
171
|
import { intlayer } from "vite-intlayer";
|
|
172
|
-
import tsconfigPaths from "vite-tsconfig-paths";
|
|
173
172
|
|
|
174
173
|
export default defineConfig({
|
|
175
|
-
plugins: [reactRouter(),
|
|
174
|
+
plugins: [reactRouter(), intlayer()],
|
|
176
175
|
});
|
|
177
176
|
```
|
|
178
177
|
|
|
@@ -805,13 +804,12 @@ This comprehensive guide provides everything you need to integrate Intlayer with
|
|
|
805
804
|
import { reactRouter } from "@react-router/dev/vite";
|
|
806
805
|
import { defineConfig } from "vite";
|
|
807
806
|
import { intlayer, intlayerProxy } from "vite-intlayer";
|
|
808
|
-
import tsconfigPaths from "vite-tsconfig-paths";
|
|
809
807
|
|
|
810
808
|
export default defineConfig({
|
|
811
809
|
plugins: [
|
|
812
810
|
intlayerProxy(), // should be placed first
|
|
813
811
|
reactRouter(),
|
|
814
|
-
|
|
812
|
+
|
|
815
813
|
intlayer(),
|
|
816
814
|
],
|
|
817
815
|
});
|
|
@@ -370,7 +370,7 @@ export default heroContent;
|
|
|
370
370
|
<!-- Отобразить контент как простой текст -->
|
|
371
371
|
<h1>{$content.title}</h1>
|
|
372
372
|
<!-- Чтобы отобразить контент с возможностью редактирования через редактор -->
|
|
373
|
-
<h1
|
|
373
|
+
<h1>{@const Title = $content.title}<Title /></h1>
|
|
374
374
|
<!-- Для отображения содержимого в виде строки -->
|
|
375
375
|
<div aria-label={$content.title.value}></div>
|
|
376
376
|
```
|
|
@@ -726,7 +726,7 @@ export default defineConfig({
|
|
|
726
726
|
<h1>{$content.title}</h1>
|
|
727
727
|
|
|
728
728
|
<!-- Отобразить контент как компонент (требуется редактором) -->
|
|
729
|
-
|
|
729
|
+
{@const Component = $content.component}<Component />
|
|
730
730
|
</div>
|
|
731
731
|
```
|
|
732
732
|
|