Skip to content

Commit 923807f

Browse files
committed
Update docs
1 parent 5391362 commit 923807f

File tree

9 files changed

+253
-97
lines changed

9 files changed

+253
-97
lines changed

.frontmatter/database/mediaDb.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

content/changelog/CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,16 @@
88

99
### 🎨 Enhancements
1010

11+
- [#441](https://github.com/estruyf/vscode-front-matter/issues/441): Show input descriptions for snippet and data forms
12+
- [#442](https://github.com/estruyf/vscode-front-matter/issues/442): Hide sidebar on data view when data file is selected + show dropdown of data files
13+
- [#788](https://github.com/estruyf/vscode-front-matter/issues/788): Show a warning on setting update when it exists in an extended configuration
1114
- [#798](https://github.com/estruyf/vscode-front-matter/issues/798): Changed dialog to slide-over for the snippet forms
12-
- [#799](https://github.com/estruyf/vscode-front-matter/issues/799): Added `frontMatter.logging` setting to define the logging output. Options are `info`, `warn`, `error`, and `verbose`. Default is `info`.
15+
- [#799](https://github.com/estruyf/vscode-front-matter/issues/799): Added `frontMatter.logging` setting to define the logging output. Options are `info`, `warn`, `error`, and `verbose`. The default is `info`.
1316
- [#800](https://github.com/estruyf/vscode-front-matter/issues/800): Add colors for the Front Matter CMS output
17+
- [#808](https://github.com/estruyf/vscode-front-matter/issues/808): Add support to generate field groups and `block` fields in content type generation
1418
- [#810](https://github.com/estruyf/vscode-front-matter/issues/810): Update the tab title based on the view
19+
- [#811](https://github.com/estruyf/vscode-front-matter/issues/811): Added `panel.gitActions` view mode option to hide the Git actions in the panel
20+
- [#812](https://github.com/estruyf/vscode-front-matter/issues/812): Added the `{{locale}}` placeholder, which can be used in the `previewPath` property
1521

1622
### ⚡️ Optimizations
1723

content/docs/content-creation/placeholders.md

Lines changed: 62 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Placeholders
33
slug: content-creation/placeholders
44
description: Learn how to use placeholders in Front Matter CMS
55
date: 2022-03-14T08:42:21.626Z
6-
lastmod: 2024-02-24T13:18:09.798Z
6+
lastmod: 2024-06-10T09:46:20.253Z
77
weight: 200.51
88
---
99

@@ -29,12 +29,14 @@ automatically fill in values when creating a new content.
2929

3030
## Special placeholders
3131

32-
| Placeholder | Description | Works for |
33-
| ----------------------- | ------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------- |
34-
| `{{seoTitle}}` | This creates a SEO friendly slug from the title. More info can be found in the [slug][02] section. | `slugTemplate` properties. |
35-
| `{{fm.<field name>}}` | The value of the field in the front matter | `slugTemplate` and `previewPath` properties. |
36-
| `{{pathToken.<index>}}` | The value of the path token at the index | `previewPath` on the page folder or the content-type. |
37-
| `{{pathToken.relPath}}` | The relative value path staring from the page folder' path | `previewPath` on the page folder or the content-type. |
32+
| Placeholder | Description | Works for |
33+
| --- | --- | --- |
34+
| `{{seoTitle}}` | This creates a SEO friendly slug from the title. More info can be found in the [slug][02] section. | `slugTemplate` properties |
35+
| `{{date\|<format>}}` | Use the publishing date of your article in the preview URL. Example: `/blog/{{date\|yyyy-MM}}` | `previewPath` property |
36+
| `{{locale}}` | The locale of the page. | `previewPath` property |
37+
| `{{fm.<field name>}}` | The value of the field in the front matter | `slugTemplate` and `previewPath` properties |
38+
| `{{pathToken.<index>}}` | The value of the path token at the index | `previewPath` on the page folder or the content-type |
39+
| `{{pathToken.relPath}}` | The relative value path staring from the page folder' path | `previewPath` on the page folder or the content-type |
3840

3941
### Example 1
4042

@@ -90,6 +92,59 @@ The above configuration results in the following path: `/blog/25/02/23/`.
9092

9193
![Placeholder field formatting](/releases/v9.0.0/placeholder-formatting.png)
9294

95+
### Example 4: using the `{{date|<format>}}` placeholder
96+
97+
The `{{date|<format>}}` placeholder can be used in the `previewPath` property and uses the field
98+
with the name `date` or a date field where the `isPublishDate` property is set to `true`.
99+
100+
```json {{ "title": "Using the date placeholder", "description": "" }}
101+
"frontMatter.content.pageFolders": [
102+
{
103+
"title": "blog",
104+
"filePrefix": null,
105+
"previewPath": "/{{fm.type}}/{{date|yyyy}}",
106+
"path": "[[workspace]]/content"
107+
}
108+
]
109+
```
110+
111+
The above configuration results in the following path: `/blog/2024/`.
112+
113+
### Example 5: using the `{{locale}}` placeholder
114+
115+
The `{{locale}}` placeholder will return the locale of the page when you have
116+
a [multi-language setup](/docs/content-creation/multilingual).
117+
118+
```json {{ "title": "Using the locale placeholder", "description": "" }}
119+
"frontMatter.content.pageFolders": [
120+
{
121+
"title": "blog",
122+
"filePrefix": null,
123+
"previewPath": "/{{locale}}",
124+
"path": "[[workspace]]/content"
125+
}
126+
]
127+
```
128+
129+
The above configuration results in the following path for English content: `/en/<slug>/`.
130+
131+
You can also ignore a specific locale by using the `ignore:<locale>` option.
132+
133+
```json {{ "title": "Ignoring a specific locale", "description": "" }}
134+
"frontMatter.content.pageFolders": [
135+
{
136+
"title": "blog",
137+
"filePrefix": null,
138+
"previewPath": "/{{locale|ignore:en}}",
139+
"path": "[[workspace]]/content"
140+
}
141+
]
142+
```
143+
144+
The above configuration results in the following path for English content: `/<slug>/`.
145+
For other locales, the preview path will generate the following path:
146+
`/<locale>/<slug>/` (e.g. `/nl/<slug>/`).
147+
93148
## Custom placeholders
94149

95150
You can define you own placeholders within the `frontMatter.content.placeholders` setting. There are

content/docs/panel.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Editor panel
33
slug: panel
44
description: null
55
date: 2021-08-30T16:13:00.546Z
6-
lastmod: 2023-10-06T13:47:51.482Z
6+
lastmod: 2024-06-10T08:24:04.381Z
77
weight: 400
88
---
99

@@ -200,6 +200,7 @@ You define a mode with an `id` and a set of features. The allowed features are t
200200
### Panel
201201

202202
- `panel.globalSettings`: Show the global settings section.
203+
- `panel.gitActions`: Show the git actions section.
203204
- `panel.seo`: Show the SEO status section.
204205
- `panel.actions`: Show the actions section.
205206
- `panel.metadata`: Show the metadata section.

content/docs/settings/available-settings.md

Lines changed: 25 additions & 1 deletion
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-26T17:54:04.814Z
6+
lastmod: 2024-06-10T09:13:40.409Z
77
weight: 1000.2
88
---
99

@@ -13,6 +13,23 @@ Here you can find an overview of all available settings.
1313

1414
## Available settings
1515

16+
### frontMatter.logging
17+
18+
Specify the logging level you want to use for the extension.
19+
20+
- Type: `string`
21+
- Default: `info`
22+
23+
Options:
24+
25+
- `verbose`
26+
- `info`
27+
- `warning`
28+
- `error`
29+
30+
> **Info**: More information on how to use it can be found in the
31+
> [troubleshooting - logging](/docs/troubleshooting#logging) section.
32+
1633
### frontMatter.config.dynamicFilePath
1734

1835
Allows you to specify a dynamic config file path which will be used during the initialization of
@@ -509,6 +526,13 @@ field value.
509526
> characters you enter. In case you want to skip some characters or all of them, you need to wrap
510527
> that part between two single quotes. Example: `"'blog/'yyyy/MM"` will result in: `blog/2021/08`.
511528
529+
### frontMatter.preview.trailingSlash
530+
531+
Specify if you want to add a trailing slash to the preview URL.
532+
533+
- Type: `boolean`
534+
- Default: `false`
535+
512536
### frontMatter.projects
513537

514538
Allows you to specify a list of projects you want to manage with Front Matter CMS. Each project

0 commit comments

Comments
 (0)