Skip to content

Commit 8a90cca

Browse files
committed
Rewrite content folders
1 parent 7be1d1f commit 8a90cca

File tree

10 files changed

+141
-62
lines changed

10 files changed

+141
-62
lines changed
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
title: Content folders
3+
slug: content-creation/content-folders
4+
description: null
5+
date: 2024-02-21T09:10:16.640Z
6+
lastmod: 2024-02-21T09:43:59.593Z
7+
weight: 200.11
8+
---
9+
10+
# Content Folders
11+
12+
Content folders are a way to organize your pages/files. Most of the time,
13+
this location is defined by the Static Site Generator (SSG) you are using.
14+
15+
To make sure that Front Matter CMS can find your content, and create the
16+
content in the correct place, you need to register the content/page folders.
17+
18+
## Registering content folders
19+
20+
The registration of the page folders is normally done during the setup of
21+
the CMS: [Step 3: Register content folder(s)][01].
22+
23+
Content folders are stored in the [frontMatter.content.pageFolders][02] setting.
24+
25+
```json {{ "title": "Example of the content folders configuration" }}
26+
{
27+
"frontMatter.content.pageFolders": [
28+
{
29+
"title": "Pages",
30+
"path": "[[workspace]]/content",
31+
"excludeSubdir": true,
32+
"previewPath": "post" // Prefixes all files with "/post/" for the page preview
33+
},
34+
{
35+
"title": "Blog posts",
36+
"path": "[[workspace]]/content/posts"
37+
},
38+
{
39+
"title": "docs",
40+
"path": "[[workspace]]/docs",
41+
"filePrefix": "",
42+
"contentTypes": ["doc"]
43+
},
44+
{
45+
"title": "archive",
46+
"path": "[[workspace]]/archive",
47+
"filePrefix": "",
48+
"disableCreation": true // Disables the creation of new content in this folder
49+
},
50+
{
51+
"title": "Multilingual",
52+
"path": "[[workspace]]/docs/en",
53+
"filePrefix": "",
54+
"defaultLocale": "en",
55+
"locales": [
56+
{
57+
"title": "English",
58+
"locale": "en"
59+
},
60+
{
61+
"title": "German",
62+
"locale": "de",
63+
"path": "../de"
64+
},
65+
{
66+
"title": "Nederlands",
67+
"locale": "nl",
68+
"path": "../nl"
69+
}
70+
]
71+
}
72+
]
73+
}
74+
```
75+
76+
Once the content folders are registered, you can start creating content with Front Matter CMS.
77+
78+
## Properties
79+
80+
| Title | Type | Description | Default | Required / Optional |
81+
| ----------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | ------------------- |
82+
| `title` | `string` | A title for the content folder path | `""` | Optional |
83+
| `path` | `string` | The path to the content folder, important is to use the `[[workspace]]` placeholder. You can also make use of placeholder to generate dynamic paths. | `""` | Required |
84+
| `excludeSubdir` | `boolean` | Exclude subdirectories from the content folder | | Optional |
85+
| `previewPath` | `string` | Allows you to set a prefix path for the page preview. Check the [preview path configuration][03] section to learn more. | | Optional |
86+
| `filePrefix` | `string` | Defines a prefix for the file name. | | Optional |
87+
| `contentTypes` | `string[]` | An array of content types to use for this folder. If not specified, all content types are used. | | Optional |
88+
| `disableCreation` | `boolean` | Disables the creation of new content in this folder. | `false` | Optional |
89+
| `defaultLocale` | `string` | Set the default locale ID for the page folder. More information can be found in the [Multilingual][04] section. | | Optional |
90+
| `locales` | `array` | Multilingual configuration on page folder level. More information can be found in the [Multilingual][04] section. | | Optional |
91+
92+
> **Important**: `[[workspace]]` is a placeholder that the extension uses to replace the workspace
93+
> path. The reason why we choose to use this, is because some do not keep the original folder name.
94+
95+
<!-- Links -->
96+
97+
[01]: "/docs/getting-started#step-3:-register-content-folder(s)"
98+
[02]: /docs/settings/overview#frontmatter.content.pagefolders
99+
[03]: /docs/site-preview#configuration
100+
[04]: /docs/content-creation/multilingual

content/docs/content-creation/content-type.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@ title: Content types
33
slug: content-creation/content-types
44
description: null
55
date: 2022-03-14T08:43:17.483Z
6-
lastmod: 2024-02-13T09:20:18.028Z
7-
weight: 200.1
6+
lastmod: 2024-02-21T09:44:40.433Z
7+
weight: 200.21
88
---
99

1010
# Content types
1111

12+
Content types are a way to define the structure of your content. Each content type can have its own
13+
set of fields.
14+
1215
## Changing the default content type
1316

1417
If you want to change the default content type, open your `frontmatter.json` and write an entry for

content/docs/content-creation/field-conditions.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ title: Field conditions
33
slug: content-creation/field-conditions
44
description: null
55
date: 2022-12-08T15:30:17.335Z
6-
lastmod: 2022-12-08T15:30:17.335Z
7-
weight: 200.3
6+
lastmod: 2024-02-21T09:11:46.147Z
7+
weight: 200.41
88
---
99

1010
# Field conditions
1111

12-
Field conditions allow you to show or hide fields based on the value of another field.
12+
Field conditions allow you to show or hide fields based on the value of another field.
1313
This is useful when you want to show a field only when a specific value is selected or provided.
1414

1515
## Show or hide fields
@@ -50,4 +50,4 @@ To show or hide a field, you need to add the `when` property to the field.
5050
| Greater than | `gt` |
5151
| Greater than or equal | `gte` |
5252
| Less than | `lt` |
53-
| Less than or equal | `lte` |
53+
| Less than or equal | `lte` |

content/docs/content-creation/fields.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ title: Fields
33
slug: content-creation/fields
44
description: null
55
date: 2022-03-14T08:42:21.626Z
6-
lastmod: 2024-02-13T09:46:22.485Z
7-
weight: 200.2
6+
lastmod: 2024-02-21T09:11:43.854Z
7+
weight: 200.31
88
---
99

1010
# Fields overview
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: Multilingual
3+
slug: content-creation/multilingual
4+
description: null
5+
date: 2024-02-21T09:10:16.640Z
6+
lastmod: 2024-02-21T09:43:53.819Z
7+
weight: 200.71
8+
---
9+
10+
# Multilingual content

content/docs/content-creation/other.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ title: Additional configuration
33
slug: content-creation/additional-config
44
description: null
55
date: 2022-03-14T08:42:21.626Z
6-
lastmod: 2023-10-06T13:30:33.717Z
7-
weight: 200.5
6+
lastmod: 2024-02-21T09:43:39.296Z
7+
weight: 200.81
88
---
99

1010
# Additional configuration
@@ -16,11 +16,13 @@ For more information on how to use the preview path, see the
1616

1717
## File prefixes
1818

19-
By default, Front Matter will use the `yyyy-MM-dd` date format for the file prefix. You can change this per page folder or per content-type.
19+
By default, Front Matter will use the `yyyy-MM-dd` date format for the file prefix.
20+
You can change this per page folder or per content-type.
2021

2122
### Page folder level
2223

23-
To change the file prefix for a specific page folder, you can add the `filePrefix` property to your page folder in the `frontMatter.content.pageFolders` setting.
24+
To change the file prefix for a specific page folder, you can add the `filePrefix`
25+
property to your page folder in the `frontMatter.content.pageFolders` setting.
2426

2527
```json
2628
{
@@ -36,9 +38,11 @@ To change the file prefix for a specific page folder, you can add the `filePrefi
3638

3739
### Content-type level
3840

39-
Similarly, you can change the file prefix for a specific content type by adding the `filePrefix` property to your content type in the `frontMatter.taxonomy.contentTypes` setting.
41+
Similarly, you can change the file prefix for a specific content type by adding the `filePrefix`
42+
property to your content type in the `frontMatter.taxonomy.contentTypes` setting.
4043

41-
> **Important**: The `filePrefix` from the content-type will override the `filePrefix` property from the page folder.
44+
> **Important**: The `filePrefix` from the content-type will override the `filePrefix`
45+
property from the page folder.
4246

4347
```json
4448
{

content/docs/content-creation/placeholders.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ title: Placeholders
33
slug: content-creation/placeholders
44
description: null
55
date: 2022-03-14T08:42:21.626Z
6-
lastmod: 2024-02-13T09:22:26.586Z
7-
weight: 200.4
6+
lastmod: 2024-02-21T09:11:54.094Z
7+
weight: 200.51
88
---
99

1010
# Placeholders

content/docs/content-creation/slug.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ title: Slug
33
slug: content-creation/slug
44
description: null
55
date: 2024-02-13T09:28:37.205Z
6-
lastmod: 2024-02-13T09:48:46.199Z
7-
weight: 200.5
6+
lastmod: 2024-02-21T09:12:52.450Z
7+
weight: 200.61
88
---
99

1010
# Slug

content/docs/custom-actions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
title: Custom actions
2+
title: Custom actions/scripts
33
slug: custom-actions
44
description: null
55
date: 2021-08-30T16:13:00.546Z
6-
lastmod: 2024-01-31T12:48:37.504Z
6+
lastmod: 2024-02-21T09:06:16.403Z
77
weight: 500
88
---
99

10-
# Custom actions
10+
# Custom actions and scripts
1111

1212
## Overview
1313

content/docs/settings/available-settings.md

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Settings overview
33
slug: settings/overview
44
description: null
55
date: 2023-02-13T16:44:09.618Z
6-
lastmod: 2024-02-13T09:17:07.601Z
6+
lastmod: 2024-02-21T09:22:54.273Z
77
weight: 1100.2
88
---
99

@@ -113,45 +113,7 @@ running the create article command.
113113
- Type: `object[]`
114114
- Default: `[]`
115115

116-
Properties:
117-
118-
| Title | Type | Description | Default | Required / Optional |
119-
| --------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | ------------------- |
120-
| `title` | `string` | A title for the content folder path | `""` | Optional |
121-
| `path` | `string` | The path to the content folder, important is to use the `[[workspace]]` placeholder. You can also make use of placeholder to generate dynamic paths. | `""` | Required |
122-
| `excludeSubdir` | `boolean` | Exclude subdirectories from the content folder | | Optional |
123-
| `previewPath` | `string` | Allows you to set a prefix path for the page preview. Check the [preview path configuration][06] section to learn more. | | Optional |
124-
| `filePrefix` | `string` | Defines a prefix for the file name. | | Optional |
125-
| `contentTypes` | `string[]` | An array of content types to use for this folder. If not specified, all content types are used. | | Optional |
126-
| `disableCreation` | `boolean` | Disables the creation of new content in this folder. | | Optional |
127-
128-
> **Important**: `[[workspace]]` is a placeholder that the extension uses to replace the workspace
129-
> path. The reason why we choose to use this, is because some do not keep the original folder name.
130-
131-
Sample:
132-
133-
```json
134-
{
135-
"frontMatter.content.pageFolders": [
136-
{
137-
"title": "Pages",
138-
"path": "[[workspace]]/content",
139-
"excludeSubdir": true,
140-
"previewPath": "post" // Prefixes all files with "/post/" for the page preview
141-
},
142-
{
143-
"title": "Blog posts",
144-
"path": "[[workspace]]/content/posts"
145-
},
146-
{
147-
"title": "docs",
148-
"path": "[[workspace]]/docs",
149-
"filePrefix": "",
150-
"contentTypes": ["doc"]
151-
}
152-
]
153-
}
154-
```
116+
> **Info**: More information on how to use it can be found in the [content folders][06] section.
155117
156118
### frontMatter.content.placeholders
157119

@@ -878,7 +840,7 @@ This setting has been deprecated since version `3.1.0` in favour of the newly in
878840
[02]: /docs/experimental
879841
[04]: /docs/content-creation#before-you-start
880842
[05]: /releases/v8.1.0/hide-fm.png
881-
[06]: /docs/site-preview#configuration
843+
[06]: /docs/content-creation/content-folders
882844
[07]: /docs/content-creation/placeholders
883845
[08]: /docs/custom-actions
884846
[09]: /docs/dashboard#card-tags

0 commit comments

Comments
 (0)