Skip to content

Commit 4e84d98

Browse files
committed
Updated docs
1 parent 4c2f1fb commit 4e84d98

File tree

2 files changed

+56
-15
lines changed

2 files changed

+56
-15
lines changed

content/docs/content-creation/content-folders.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Content folders
33
slug: content-creation/content-folders
44
description: null
55
date: 2024-02-21T09:10:16.640Z
6-
lastmod: 2024-02-21T14:56:03.901Z
6+
lastmod: 2024-02-22T08:54:27.654Z
77
weight: 200.11
88
---
99

@@ -108,8 +108,8 @@ and clicking on `Register folder` under the Front Matter CMS context menu.
108108
| `filePrefix` | `string` | Defines a prefix for the file name. | | Optional |
109109
| `contentTypes` | `string[]` | An array of content types to use for this folder. If not specified, all content types are used. | | Optional |
110110
| `disableCreation` | `boolean` | Disables the creation of new content in this folder. | `false` | Optional |
111-
| `defaultLocale` | `string` | Set the default locale ID for the page folder. More information can be found in the [Multilingual][04] section. | | Optional |
112-
| `locales` | `array` | Multilingual configuration on page folder level. More information can be found in the [Multilingual][04] section. | | Optional |
111+
| `defaultLocale` | `string` | Set the default locale ID for the page folder. More information can be found in the [Multilingual][04] section. | | Optional |
112+
| `locales` | `array` | Multilingual configuration on page folder level. More information can be found in the [Multilingual][04] section. | | Optional |
113113

114114
> **Important**: `[[workspace]]` is a placeholder that the extension uses to replace the workspace
115115
> path. The reason why we choose to use this, is because some do not keep the original folder name.

content/docs/content-creation/multilingual.md

Lines changed: 53 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Multilingual
33
slug: content-creation/multilingual
44
description: null
55
date: 2024-02-21T09:10:16.640Z
6-
lastmod: 2024-02-22T07:31:02.562Z
6+
lastmod: 2024-02-22T09:02:18.228Z
77
weight: 200.71
88
---
99

@@ -29,14 +29,18 @@ property on the `frontMatter.content.pageFolders` setting.
2929
"frontMatter.content.pageFolders": [
3030
{
3131
"title": "Multilingual",
32-
"path": "[[workspace]]/docs/en",
32+
"path": "[[workspace]]/docs",
3333
"filePrefix": "",
3434
"defaultLocale": "en" // This value needs to map to the locale defined in the i18n setting
3535
}
3636
]
3737
}
3838
```
3939

40+
> **Important**: The path for the default locale is defined by the content folder path
41+
> and the i18n locale path. For example, if the content folder path is `[[workspace]]/docs` and
42+
> the i18n locale path is `en`, the default locale path will be `[[workspace]]/docs/en`.
43+
4044
### Define the locales
4145

4246
You can define the locales on two levels:
@@ -54,14 +58,46 @@ You can define the locales on two levels:
5458
| --- | --- | --- |
5559
| `title` | The title of the locale | No |
5660
| `locale` | The locale code | Yes |
57-
| `path` | The path to the locale and relative to the path of the content folder. | No |
61+
| `path` | The path to for the locale. This path value is used in combination with the content folder's path. | Yes |
5862

5963
#### Global level
6064

6165
To define the locales on the global level, you need to use the `frontMatter.content.i18n`
6266
setting.
6367

6468
```json {{ "title": "Example of the global i18n configuration" }}
69+
{
70+
"frontMatter.content.i18n": [
71+
{
72+
"title": "English",
73+
"locale": "en",
74+
"path": "en"
75+
},
76+
{
77+
"title": "German",
78+
"locale": "de",
79+
"path": "de"
80+
},
81+
{
82+
"title": "Dutch",
83+
"locale": "nl",
84+
"path": "nl"
85+
}
86+
]
87+
}
88+
```
89+
90+
In combination with the above content folder configuration, the contents will be
91+
stored in the following paths:
92+
93+
- English: `[[workspace]]/docs/en`
94+
- German: `[[workspace]]/docs/de`
95+
- Dutch: `[[workspace]]/docs/nl`
96+
97+
If you want, you can also create the default content in the root of the content folder.
98+
You can use use the `.` value for the `path` property.
99+
100+
```json {{ "title": "Example of the global i18n configuration with default content in the root" }}
65101
{
66102
"frontMatter.content.i18n": [
67103
{
@@ -72,19 +108,23 @@ setting.
72108
{
73109
"title": "German",
74110
"locale": "de",
75-
"path": "../de"
111+
"path": "de"
76112
},
77113
{
78-
"title": "Nederlands",
114+
"title": "Dutch",
79115
"locale": "nl",
80-
"path": "../nl"
116+
"path": "nl"
81117
}
82118
]
83119
}
84120
```
85121

86-
> **Important**: The default locale (like the **English** locale) does not
87-
> require to define a `path` as it is defined by the content folder configuration.
122+
In combination with the above content folder configuration, the contents will be
123+
stored in the following paths:
124+
125+
- English: `[[workspace]]/docs`
126+
- German: `[[workspace]]/docs/de`
127+
- Dutch: `[[workspace]]/docs/nl`
88128

89129
#### Content folder level
90130

@@ -96,18 +136,19 @@ override the global locales for a specific content folder.
96136
"frontMatter.content.pageFolders": [
97137
{
98138
"title": "Multilingual",
99-
"path": "[[workspace]]/docs/en",
139+
"path": "[[workspace]]/docs",
100140
"filePrefix": "",
101141
"defaultLocale": "en",
102142
"locales": [
103143
{
104144
"title": "English",
105-
"locale": "en"
145+
"locale": "en",
146+
"path": "en"
106147
},
107148
{
108149
"title": "Nederlands",
109150
"locale": "nl",
110-
"path": "../nl"
151+
"path": "nl"
111152
}
112153
]
113154
}
@@ -120,7 +161,7 @@ override the global locales for a specific content folder.
120161
Once the multilingual settings are configured, you can create content in multiple
121162
languages with Front Matter CMS.
122163

123-
You can create content translations by starting from the default locale content and
164+
You can create content translations by starting from the locale content and
124165
then you can use any of the following methods to create a new translation:
125166

126167
- Use the `Front Matter: Create new translation` command from the command palette

0 commit comments

Comments
 (0)