Skip to content

Updated docs #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .frontmatter/database/mediaDb.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"reflowMarkdown.preferredLineLength": 100,
"[markdown]": {
// "editor.rulers": [76, 80, 96, 100]
"editor.rulers": [76, 80, 96, 100]
}
}
23 changes: 21 additions & 2 deletions content/changelog/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
# Change Log

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

### ✨ New features

- [#823](https://github.com/estruyf/vscode-front-matter/issues/823): Integrated GitHub Copilot support for titles, descriptions, and tags
- [#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

### 🎨 Enhancements

- [#833](https://github.com/estruyf/vscode-front-matter/issues/833): Added support for Asciidoc files
- [#834](https://github.com/estruyf/vscode-front-matter/issues/834): Added the ability to create new data files for a data folder
- [#841](https://github.com/estruyf/vscode-front-matter/issues/841): Enable placeholders for file prefixes
- [#846](https://github.com/estruyf/vscode-front-matter/issues/846): Added GitHub Copilot action for title field
- [#848](https://github.com/estruyf/vscode-front-matter/issues/848): Set the default GitHub Copilot model to `gpt-4o-mini`

### 🐞 Fixes

- [#842](https://github.com/estruyf/vscode-front-matter/issues/842): Allow to set the `frontMatter.taxonomy.slugTemplate` setting to an empty string
- [#845](https://github.com/estruyf/vscode-front-matter/issues/845): Fix empty values for number fields

## [10.3.0] - 2024-08-13 - [Release notes](https://beta.frontmatter.codes/updates/v10.3.0)

### ✨ New features

- [#823](https://github.com/estruyf/vscode-front-matter/issues/823): Integrated GitHub Copilot support for titles, descriptions, and taxonomy field suggestions
- [#824](https://github.com/estruyf/vscode-front-matter/issues/824): Added the ability to link custom actions to fields

### 🎨 Enhancements
Expand Down
77 changes: 77 additions & 0 deletions content/changelog/v10.4.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
title: Version 10.4.0 release notes
description: ""
date: 2024-09-16T11:24:29.669Z
lastmod: 2024-09-16T12:33:25.797Z
slug: v10.4.0
fmContentType: changelog
---

## Placeholder support for file prefixes and new file index placeholder

We have added placeholder support for file prefixes, this allows you to have more control over the
file naming convention during file creation.

A new placeholder `{{filePrefix.index}}` is available which adds
the index number of the file in the folder with leading zeros.

```json {{ "title": "Using the file prefix index placeholder" }}
{
"frontMatter.content.pageFolders": [{
"title": "articles",
"path": "[[workspace]]/content/prefixes/",
"filePrefix": "{{filePrefix.index}}"
}]
}
```

This will create files with the following names:
`001-article.md`, `002-article.md`, `003-article.md`, etc.

> **Info**: You can find more information about the file prefix settings in the
> [file prefix placeholders](/docs/content-creation/placeholders#file-prefix-placeholders)
> documentation.

## Default GitHub Copilot model set to gpt-4o-mini

We have set the default GitHub Copilot model to `gpt-4o-mini` to improve
the title, description, and other field suggestions.

The previous default model was `gpt-3.5-turbo`.

> **Info**: You can read more about the `gpt-4o-mini` model on the
> [OpenAI - GPT-4o mini](https://openai.com/index/gpt-4o-mini-advancing-cost-efficient-intelligence/)
> article.

## Trigger GitHub Copilot title suggestions from the title field

We have added a new action button to trigger the GitHub Copilot title suggestions
directly from the title field.

![GitHub Copilot - Title suggestions](/releases/v10.4.0/github-copilot-title-suggestions.webp)

## Data file creation support

In this release, we have added support for creating new data files for a data folder.
This allows you to create new data files directly from the Front Matter CMS dashboard.

![Create new data file](/releases/v10.4.0/empty-data-dashboard.webp)

## Related issues/enhancements

### ✨ New features

- [#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

### 🎨 Enhancements

- [#833](https://github.com/estruyf/vscode-front-matter/issues/833): Added support for Asciidoc files
- [#834](https://github.com/estruyf/vscode-front-matter/issues/834): Added the ability to create new data files for a data folder
- [#841](https://github.com/estruyf/vscode-front-matter/issues/841): Enable placeholders for file prefixes
- [#846](https://github.com/estruyf/vscode-front-matter/issues/846): Added GitHub Copilot action for title field
- [#848](https://github.com/estruyf/vscode-front-matter/issues/848): Set the default GitHub Copilot model to `gpt-4o-mini`

### 🐞 Fixes

- [#842](https://github.com/estruyf/vscode-front-matter/issues/842): Allow to set the `frontMatter.taxonomy.slugTemplate` setting to an empty string
- [#845](https://github.com/estruyf/vscode-front-matter/issues/845): Fix empty values for number fields
4 changes: 2 additions & 2 deletions content/changelog/v8.3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Version 8.3.0 release notes
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!
date: 2023-02-13T19:10:04.012Z
lastmod: 2023-03-25T20:24:08.978Z
lastmod: 2024-09-16T12:12:54.097Z
type: changelog
slug: v8.3.0
---
Expand Down Expand Up @@ -64,7 +64,7 @@ The above snippet shows both new features:

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>`.

> **Info**: Read more about these placeholder features in the [special placeholders](/docs/content-creation/placeholders#special-placeholders) section.
> **Info**: Read more about these placeholder features in the [preview path placeholders](/docs/content-creation/placeholders#preview-path-placeholders) section.

## Allowing you to change the preview URL

Expand Down
6 changes: 3 additions & 3 deletions content/docs/ai/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: AI features
slug: ai-features
description: null
date: 2024-08-13T07:26:50.054Z
lastmod: 2024-08-13T11:34:21.076Z
lastmod: 2024-09-16T12:28:36.834Z
weight: 880
---

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

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

```json {{ "title": "Change GitHub Copilot's AI model" }}
{
"frontMatter.copilot.family": "gpt-4.0-turbo"
"frontMatter.copilot.family": "gpt-4o-mini"
}
```

Expand Down
12 changes: 8 additions & 4 deletions content/docs/content-creation/other.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Additional configuration
slug: content-creation/additional-config
description: null
date: 2022-03-14T08:42:21.626Z
lastmod: 2024-02-21T09:43:39.296Z
lastmod: 2024-09-16T12:23:31.690Z
weight: 200.81
---

Expand All @@ -16,9 +16,13 @@ For more information on how to use the preview path, see the

## File prefixes

By default, Front Matter will use the `yyyy-MM-dd` date format for the file prefix.
By default, Front Matter CMS uses the date placeholder with the `yyyy-MM-dd`
format (`{{date|yyyy-MM-dd}}`) for the file prefix.
You can change this per page folder or per content-type.

> **Info**: You can use other placeholders for the file prefix as well. For more information, see the
> [file prefix placeholders](/docs/content-creation/placeholders#file-prefix-placeholders) documentation.

### Page folder level

To change the file prefix for a specific page folder, you can add the `filePrefix`
Expand All @@ -30,7 +34,7 @@ property to your page folder in the `frontMatter.content.pageFolders` setting.
{
"title": "Blog",
"path": "[[workspace]]/content/blog",
"filePrefix": "yyyy"
"filePrefix": "{{date|yyyy}}"
}
]
}
Expand All @@ -49,7 +53,7 @@ property from the page folder.
"frontMatter.taxonomy.contentTypes": [
{
"name": "default",
"filePrefix": "yyyy-MM",
"filePrefix": "{{date|yyyy-MM}}",
"fields": [
...
]
Expand Down
108 changes: 87 additions & 21 deletions content/docs/content-creation/placeholders.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,21 @@ title: Placeholders
slug: content-creation/placeholders
description: Learn how to use placeholders in Front Matter CMS
date: 2022-03-14T08:42:21.626Z
lastmod: 2024-06-14T09:26:58.102Z
lastmod: 2024-09-16T12:13:56.139Z
weight: 200.51
---

# Placeholders

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

## Default placeholders

The following placeholders can be used in the fields `default` property,
`slugTemplate`, `previewPath`, and `filePrefix`:

| Placeholder | Description |
| ------------ | ------------------------------------------------------------------------------------------------ |
| `{{title}}` | Title of the page |
Expand All @@ -27,20 +31,48 @@ automatically fill in values when creating a new content.
| `{{ampm}}` | Show AM/PM |
| `{{minute}}` | Current minute |

## Special placeholders
## Slug placeholders

The slug placeholders are used to generate a slug based on the title of the page. The following
placeholders can be used in the `slugTemplate` property:

| Placeholder | Description |
| --- | --- |
| `{{seoTitle}}` | This creates a SEO friendly slug from the title. More info can be found in the [slug][02] section. |
| `{{date\|<format>}}` | Use the publishing date of your article in the preview URL. Example: `{{date\|yyyy-MM}}` |
| `{{fm.<field name>}}` | The value of the field in the front matter |
| `{{pathToken.<index>}}` | The value of the path token at the index |
| `{{pathToken.relPath}}` | The relative value path staring from the page folder' path |

## Preview path placeholders

The preview path placeholders are used to generate a dynamic preview path based on the front matter
fields or other values. The following placeholders can be used in the `previewPath` property:

| Placeholder | Description |
| --- | --- |
| `{{date\|<format>}}` | Use the publishing date of your article in the preview URL. Example: `/blog/{{date\|yyyy-MM}}` |
| `{{locale}}` | The locale of the page. |
| `{{fm.<field name>}}` | The value of the field in the front matter |
| `{{pathToken.<index>}}` | The value of the path token at the index |
| `{{pathToken.relPath}}` | The relative value path staring from the page folder' path |

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

### Example 1
The file prefix placeholders are used to generate a dynamic file prefix. The following placeholders
can be used in the `filePrefix` property:

Example of how you can use the special placeholders:
| Placeholder | Description |
| --- | --- |
| `{{filePrefix.index\|<zeros:nr>}}` | The index number of the file in the folder |
| `{{date\|<format>}}` | Use the publishing date of your article in the preview URL. Example: `{{date\|yyyy-MM}}` |
| `{{locale}}` | The locale of the page. |

## Using placeholders

### Example 1: general usage

Example of how you can use the placeholders in the `previewPath` and `path` property:

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

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

### Example 2
The preview path will generate the following path: `/post/2024/09/<slug>`.

### Example 2: using the relative path placeholder

Example of how you can use the `{{pathToken.relPath}}` placeholder:

```json {{ "title": "Using the relative path token", "description": "" }}
"frontMatter.content.pageFolders": [
Expand All @@ -82,20 +119,19 @@ an example of how you can use field formatting:
{
"title": "blog",
"filePrefix": null,
"previewPath": "'/{{fm.type}}/{{fm.pubDate|format:dd/MM/yy}}/'",
"previewPath": "/{{fm.fmContentType}}/{{fm.date|format:dd/MM/yy}}/",
"path": "[[workspace]]/content"
}
]
```

The above configuration results in the following path: `/blog/25/02/23/`.
The above configuration results in the following path: `/blog/16/09/24/`.

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

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

The `{{date|<format>}}` placeholder can be used in the `previewPath` property and uses the field
with the name `date` or a date field where the `isPublishDate` property is set to `true`.
The `{{date|<format>}}` placeholder uses the publishing date and can be used as follows:

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

### Example 6: using the {{filePrefix.index}} placeholder

The `{{filePrefix.index}}` placeholder returns the index number of the file in the folder.

```json {{ "title": "Using the file prefix index placeholder" }}
{
"frontMatter.content.pageFolders": [{
"title": "articles",
"path": "[[workspace]]/content/prefixes/",
"filePrefix": "{{filePrefix.index}}"
}]
}
```

The above configuration results in the following file names: `001-article.md`, `002-article.md`, ...

The `zeros` parameter is optional and allows you to specify the leading zeros to add before the
index number. The default value is `3`. You can change this value by adding the number of zeros you
want to add.

```json {{ "title": "Using the file prefix index placeholder with leading zeros" }}
{
"frontMatter.content.pageFolders": [{
"title": "articles",
"path": "[[workspace]]/content/prefixes/",
"filePrefix": "{{filePrefix.index|zeros:4}}"
}]
}
```

## Custom placeholders

You can define you own placeholders within the `frontMatter.content.placeholders` setting. There are
Expand Down
Loading