Skip to content

Commit 774850b

Browse files
authored
Merge pull request #30 from FrontMatter/beta
Updated docs
2 parents 07898fe + cd5a4e1 commit 774850b

20 files changed

+394
-643
lines changed

.frontmatter/database/mediaDb.json

+1-1
Large diffs are not rendered by default.

.vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"reflowMarkdown.preferredLineLength": 100,
33
"[markdown]": {
4-
// "editor.rulers": [76, 80, 96, 100]
4+
"editor.rulers": [76, 80, 96, 100]
55
}
66
}

content/changelog/CHANGELOG.md

+21-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,29 @@
11
# Change Log
22

3-
## [10.3.0] - 2024-xx-xx - [Release notes](https://beta.frontmatter.codes/updates/v10.3.0)
3+
## [10.4.0] - 2024-xx-xx
44

55
### ✨ New features
66

7-
- [#823](https://github.com/estruyf/vscode-front-matter/issues/823): Integrated GitHub Copilot support for titles, descriptions, and tags
7+
- [#844](https://github.com/estruyf/vscode-front-matter/issues/844): New `{{filePrefix.index}}` placeholder to add the index number of the file in the folder
8+
9+
### 🎨 Enhancements
10+
11+
- [#833](https://github.com/estruyf/vscode-front-matter/issues/833): Added support for Asciidoc files
12+
- [#834](https://github.com/estruyf/vscode-front-matter/issues/834): Added the ability to create new data files for a data folder
13+
- [#841](https://github.com/estruyf/vscode-front-matter/issues/841): Enable placeholders for file prefixes
14+
- [#846](https://github.com/estruyf/vscode-front-matter/issues/846): Added GitHub Copilot action for title field
15+
- [#848](https://github.com/estruyf/vscode-front-matter/issues/848): Set the default GitHub Copilot model to `gpt-4o-mini`
16+
17+
### 🐞 Fixes
18+
19+
- [#842](https://github.com/estruyf/vscode-front-matter/issues/842): Allow to set the `frontMatter.taxonomy.slugTemplate` setting to an empty string
20+
- [#845](https://github.com/estruyf/vscode-front-matter/issues/845): Fix empty values for number fields
21+
22+
## [10.3.0] - 2024-08-13 - [Release notes](https://beta.frontmatter.codes/updates/v10.3.0)
23+
24+
### ✨ New features
25+
26+
- [#823](https://github.com/estruyf/vscode-front-matter/issues/823): Integrated GitHub Copilot support for titles, descriptions, and taxonomy field suggestions
827
- [#824](https://github.com/estruyf/vscode-front-matter/issues/824): Added the ability to link custom actions to fields
928

1029
### 🎨 Enhancements

content/changelog/v10.4.0.md

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
title: Version 10.4.0 release notes
3+
description: ""
4+
date: 2024-09-16T11:24:29.669Z
5+
lastmod: 2024-09-16T12:33:25.797Z
6+
slug: v10.4.0
7+
fmContentType: changelog
8+
---
9+
10+
## Placeholder support for file prefixes and new file index placeholder
11+
12+
We have added placeholder support for file prefixes, this allows you to have more control over the
13+
file naming convention during file creation.
14+
15+
A new placeholder `{{filePrefix.index}}` is available which adds
16+
the index number of the file in the folder with leading zeros.
17+
18+
```json {{ "title": "Using the file prefix index placeholder" }}
19+
{
20+
"frontMatter.content.pageFolders": [{
21+
"title": "articles",
22+
"path": "[[workspace]]/content/prefixes/",
23+
"filePrefix": "{{filePrefix.index}}"
24+
}]
25+
}
26+
```
27+
28+
This will create files with the following names:
29+
`001-article.md`, `002-article.md`, `003-article.md`, etc.
30+
31+
> **Info**: You can find more information about the file prefix settings in the
32+
> [file prefix placeholders](/docs/content-creation/placeholders#file-prefix-placeholders)
33+
> documentation.
34+
35+
## Default GitHub Copilot model set to gpt-4o-mini
36+
37+
We have set the default GitHub Copilot model to `gpt-4o-mini` to improve
38+
the title, description, and other field suggestions.
39+
40+
The previous default model was `gpt-3.5-turbo`.
41+
42+
> **Info**: You can read more about the `gpt-4o-mini` model on the
43+
> [OpenAI - GPT-4o mini](https://openai.com/index/gpt-4o-mini-advancing-cost-efficient-intelligence/)
44+
> article.
45+
46+
## Trigger GitHub Copilot title suggestions from the title field
47+
48+
We have added a new action button to trigger the GitHub Copilot title suggestions
49+
directly from the title field.
50+
51+
![GitHub Copilot - Title suggestions](/releases/v10.4.0/github-copilot-title-suggestions.webp)
52+
53+
## Data file creation support
54+
55+
In this release, we have added support for creating new data files for a data folder.
56+
This allows you to create new data files directly from the Front Matter CMS dashboard.
57+
58+
![Create new data file](/releases/v10.4.0/empty-data-dashboard.webp)
59+
60+
## Related issues/enhancements
61+
62+
### ✨ New features
63+
64+
- [#844](https://github.com/estruyf/vscode-front-matter/issues/844): New `{{filePrefix.index}}` placeholder to add the index number of the file in the folder
65+
66+
### 🎨 Enhancements
67+
68+
- [#833](https://github.com/estruyf/vscode-front-matter/issues/833): Added support for Asciidoc files
69+
- [#834](https://github.com/estruyf/vscode-front-matter/issues/834): Added the ability to create new data files for a data folder
70+
- [#841](https://github.com/estruyf/vscode-front-matter/issues/841): Enable placeholders for file prefixes
71+
- [#846](https://github.com/estruyf/vscode-front-matter/issues/846): Added GitHub Copilot action for title field
72+
- [#848](https://github.com/estruyf/vscode-front-matter/issues/848): Set the default GitHub Copilot model to `gpt-4o-mini`
73+
74+
### 🐞 Fixes
75+
76+
- [#842](https://github.com/estruyf/vscode-front-matter/issues/842): Allow to set the `frontMatter.taxonomy.slugTemplate` setting to an empty string
77+
- [#845](https://github.com/estruyf/vscode-front-matter/issues/845): Fix empty values for number fields

content/changelog/v8.3.0.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Version 8.3.0 release notes
33
description: FrontMatter is back and better than ever with its latest release, version 8.3.0! This update is packed with new features and improvements, including external config support, allowing you to easily import configurations from external files. Plus, with VSCode theme support, you can customize your development environment to your heart's content. But that's not all - there are many other exciting additions and enhancements waiting for you. Check out the release notes to see what's new and upgrade to FrontMatter 8.3.0 today!
44
date: 2023-02-13T19:10:04.012Z
5-
lastmod: 2023-03-25T20:24:08.978Z
5+
lastmod: 2024-09-16T12:12:54.097Z
66
type: changelog
77
slug: v8.3.0
88
---
@@ -64,7 +64,7 @@ The above snippet shows both new features:
6464

6565
When you would create a new content item, the path will be generated based on the `path` property. In this case, it will be: `[[workspace]]/content/2023/02`. The preview path will generate the following path: `/post/2023/02/<slug>`.
6666

67-
> **Info**: Read more about these placeholder features in the [special placeholders](/docs/content-creation/placeholders#special-placeholders) section.
67+
> **Info**: Read more about these placeholder features in the [preview path placeholders](/docs/content-creation/placeholders#preview-path-placeholders) section.
6868
6969
## Allowing you to change the preview URL
7070

content/docs/ai/index.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: AI features
33
slug: ai-features
44
description: null
55
date: 2024-08-13T07:26:50.054Z
6-
lastmod: 2024-08-13T11:34:21.076Z
6+
lastmod: 2024-09-16T12:28:36.834Z
77
weight: 880
88
---
99

@@ -27,12 +27,12 @@ The AI features are available in the following places:
2727
- Description suggestions based on the title and content
2828
- Taxonomy suggestions based on the title, content, and available tags
2929

30-
By default the `gpt-3.5-turbo` model is used to generate the suggestions. You can change the model
30+
By default the `gpt-4o-mini` model is used to generate the suggestions. You can change the model
3131
by updating the `frontMatter.copilot.family` setting in your `frontmatter.json` file.
3232

3333
```json {{ "title": "Change GitHub Copilot's AI model" }}
3434
{
35-
"frontMatter.copilot.family": "gpt-4.0-turbo"
35+
"frontMatter.copilot.family": "gpt-4o-mini"
3636
}
3737
```
3838

content/docs/content-creation/other.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Additional configuration
33
slug: content-creation/additional-config
44
description: null
55
date: 2022-03-14T08:42:21.626Z
6-
lastmod: 2024-02-21T09:43:39.296Z
6+
lastmod: 2024-09-16T12:23:31.690Z
77
weight: 200.81
88
---
99

@@ -16,9 +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.
19+
By default, Front Matter CMS uses the date placeholder with the `yyyy-MM-dd`
20+
format (`{{date|yyyy-MM-dd}}`) for the file prefix.
2021
You can change this per page folder or per content-type.
2122

23+
> **Info**: You can use other placeholders for the file prefix as well. For more information, see the
24+
> [file prefix placeholders](/docs/content-creation/placeholders#file-prefix-placeholders) documentation.
25+
2226
### Page folder level
2327

2428
To change the file prefix for a specific page folder, you can add the `filePrefix`
@@ -30,7 +34,7 @@ property to your page folder in the `frontMatter.content.pageFolders` setting.
3034
{
3135
"title": "Blog",
3236
"path": "[[workspace]]/content/blog",
33-
"filePrefix": "yyyy"
37+
"filePrefix": "{{date|yyyy}}"
3438
}
3539
]
3640
}
@@ -49,7 +53,7 @@ property from the page folder.
4953
"frontMatter.taxonomy.contentTypes": [
5054
{
5155
"name": "default",
52-
"filePrefix": "yyyy-MM",
56+
"filePrefix": "{{date|yyyy-MM}}",
5357
"fields": [
5458
...
5559
]

content/docs/content-creation/placeholders.md

+87-21
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,21 @@ 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-06-14T09:26:58.102Z
6+
lastmod: 2024-09-16T12:13:56.139Z
77
weight: 200.51
88
---
99

1010
# Placeholders
1111

12-
Placeholders can be used in content type fields or templates. The placeholders allow you to
13-
automatically fill in values when creating a new content.
12+
Placeholders can be used in fields, slug templates, preview paths, and file prefix settings.
13+
These placeholders allow you to generate dynamic values based on the front matter fields or other
14+
values.
1415

1516
## Default placeholders
1617

18+
The following placeholders can be used in the fields `default` property,
19+
`slugTemplate`, `previewPath`, and `filePrefix`:
20+
1721
| Placeholder | Description |
1822
| ------------ | ------------------------------------------------------------------------------------------------ |
1923
| `{{title}}` | Title of the page |
@@ -27,20 +31,48 @@ automatically fill in values when creating a new content.
2731
| `{{ampm}}` | Show AM/PM |
2832
| `{{minute}}` | Current minute |
2933

30-
## Special placeholders
34+
## Slug placeholders
35+
36+
The slug placeholders are used to generate a slug based on the title of the page. The following
37+
placeholders can be used in the `slugTemplate` property:
38+
39+
| Placeholder | Description |
40+
| --- | --- |
41+
| `{{seoTitle}}` | This creates a SEO friendly slug from the title. More info can be found in the [slug][02] section. |
42+
| `{{date\|<format>}}` | Use the publishing date of your article in the preview URL. Example: `{{date\|yyyy-MM}}` |
43+
| `{{fm.<field name>}}` | The value of the field in the front matter |
44+
| `{{pathToken.<index>}}` | The value of the path token at the index |
45+
| `{{pathToken.relPath}}` | The relative value path staring from the page folder' path |
46+
47+
## Preview path placeholders
48+
49+
The preview path placeholders are used to generate a dynamic preview path based on the front matter
50+
fields or other values. The following placeholders can be used in the `previewPath` property:
51+
52+
| Placeholder | Description |
53+
| --- | --- |
54+
| `{{date\|<format>}}` | Use the publishing date of your article in the preview URL. Example: `/blog/{{date\|yyyy-MM}}` |
55+
| `{{locale}}` | The locale of the page. |
56+
| `{{fm.<field name>}}` | The value of the field in the front matter |
57+
| `{{pathToken.<index>}}` | The value of the path token at the index |
58+
| `{{pathToken.relPath}}` | The relative value path staring from the page folder' path |
3159

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 |
60+
## File prefix placeholders
4061

41-
### Example 1
62+
The file prefix placeholders are used to generate a dynamic file prefix. The following placeholders
63+
can be used in the `filePrefix` property:
4264

43-
Example of how you can use the special placeholders:
65+
| Placeholder | Description |
66+
| --- | --- |
67+
| `{{filePrefix.index\|<zeros:nr>}}` | The index number of the file in the folder |
68+
| `{{date\|<format>}}` | Use the publishing date of your article in the preview URL. Example: `{{date\|yyyy-MM}}` |
69+
| `{{locale}}` | The locale of the page. |
70+
71+
## Using placeholders
72+
73+
### Example 1: general usage
74+
75+
Example of how you can use the placeholders in the `previewPath` and `path` property:
4476

4577
```json {{ "title": "Using the special placeholders", "description": "" }}
4678
"frontMatter.content.pageFolders": [
@@ -54,9 +86,14 @@ Example of how you can use the special placeholders:
5486
]
5587
```
5688

57-
The preview path will generate the following path: `/post/2023/02/<slug>`.
89+
When you create a new content item, the path will be generated based on the `path` property. In this
90+
case, it will be: `[[workspace]]/content/2024/09`.
5891

59-
### Example 2
92+
The preview path will generate the following path: `/post/2024/09/<slug>`.
93+
94+
### Example 2: using the relative path placeholder
95+
96+
Example of how you can use the `{{pathToken.relPath}}` placeholder:
6097

6198
```json {{ "title": "Using the relative path token", "description": "" }}
6299
"frontMatter.content.pageFolders": [
@@ -82,20 +119,19 @@ an example of how you can use field formatting:
82119
{
83120
"title": "blog",
84121
"filePrefix": null,
85-
"previewPath": "'/{{fm.type}}/{{fm.pubDate|format:dd/MM/yy}}/'",
122+
"previewPath": "/{{fm.fmContentType}}/{{fm.date|format:dd/MM/yy}}/",
86123
"path": "[[workspace]]/content"
87124
}
88125
]
89126
```
90127

91-
The above configuration results in the following path: `/blog/25/02/23/`.
128+
The above configuration results in the following path: `/blog/16/09/24/`.
92129

93-
![Placeholder field formatting](/releases/v9.0.0/placeholder-formatting.png)
130+
![Define the preview URL with placeholders](/releases/v10.4.0/define-preview-url.webp)
94131

95132
### Example 4: using the {{date\|\<format\>}} placeholder
96133

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`.
134+
The `{{date|<format>}}` placeholder uses the publishing date and can be used as follows:
99135

100136
```json {{ "title": "Using the date placeholder", "description": "" }}
101137
"frontMatter.content.pageFolders": [
@@ -147,6 +183,36 @@ The above configuration results in the following path for English content: `/<sl
147183
For other locales, the preview path will generate the following path:
148184
`/<locale>/<slug>/` (e.g. `/nl/<slug>/`).
149185

186+
### Example 6: using the {{filePrefix.index}} placeholder
187+
188+
The `{{filePrefix.index}}` placeholder returns the index number of the file in the folder.
189+
190+
```json {{ "title": "Using the file prefix index placeholder" }}
191+
{
192+
"frontMatter.content.pageFolders": [{
193+
"title": "articles",
194+
"path": "[[workspace]]/content/prefixes/",
195+
"filePrefix": "{{filePrefix.index}}"
196+
}]
197+
}
198+
```
199+
200+
The above configuration results in the following file names: `001-article.md`, `002-article.md`, ...
201+
202+
The `zeros` parameter is optional and allows you to specify the leading zeros to add before the
203+
index number. The default value is `3`. You can change this value by adding the number of zeros you
204+
want to add.
205+
206+
```json {{ "title": "Using the file prefix index placeholder with leading zeros" }}
207+
{
208+
"frontMatter.content.pageFolders": [{
209+
"title": "articles",
210+
"path": "[[workspace]]/content/prefixes/",
211+
"filePrefix": "{{filePrefix.index|zeros:4}}"
212+
}]
213+
}
214+
```
215+
150216
## Custom placeholders
151217

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

0 commit comments

Comments
 (0)