Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
estruyf committed Dec 12, 2023
2 parents ebbaeda + 7b943c7 commit 5d9cd08
Show file tree
Hide file tree
Showing 13 changed files with 336 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .frontmatter/database/mediaDb.json

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion content/changelog/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Change Log

## [9.4.0] - 2023-xx-xx
## [9.4.0] - 2023-12-12 - [Release notes](https://beta.frontmatter.codes/updates/v9.4.0)

### ✨ New features

Expand All @@ -17,6 +17,7 @@
- [#709](https://github.com/estruyf/vscode-front-matter/issues/709): Take "where clause" into account on content creation
- [#710](https://github.com/estruyf/vscode-front-matter/issues/710): Hide child field when parent field its "when clause" is not met, also remove the fields from the content
- [#713](https://github.com/estruyf/vscode-front-matter/issues/713): Add the ability to always use quotes around string values in front matter
- [#722](https://github.com/estruyf/vscode-front-matter/issues/722): Allow to create sub-content which shows a dialog to select the parent folder

### ⚡️ Optimizations

Expand All @@ -37,7 +38,9 @@
- [#711](https://github.com/estruyf/vscode-front-matter/issues/711): Fix in character mapping in the slug field
- [#712](https://github.com/estruyf/vscode-front-matter/issues/712): Keep the search context when deleting media files
- [#714](https://github.com/estruyf/vscode-front-matter/issues/714): Fix for taxonomy filtering from taxonomy view to content view
- [#717](https://github.com/estruyf/vscode-front-matter/issues/717): Fix in loading yaml data files
- [#718](https://github.com/estruyf/vscode-front-matter/issues/718): Fix JSON schema for the `frontMatter.panel.actions.disabled` setting
- [#719](https://github.com/estruyf/vscode-front-matter/issues/719): Fix styling on data view with objects views

## [9.3.1] - 2023-10-27

Expand Down
4 changes: 2 additions & 2 deletions content/changelog/v8.4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
title: Version 8.4.0 release notes
description: Get ready to level up your Front Matter CMS experience with the latest 8.4.0 release! 🚀 We've packed this update with a ton of new features including support for external UI scripts, implementation of Front Matter AI powered by mendable.ai, added taxonomy AI suggestions for GitHub sponsors, and more! 💪
date: 2023-04-03T15:00:03.981Z
lastmod: 2023-11-02T15:02:48.410Z
slug: ""
lastmod: 2023-12-12T15:37:03.329Z
slug: v8.4.0
type: changelog
---

Expand Down
4 changes: 2 additions & 2 deletions content/changelog/v9.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
title: Version 9.0.0 release notes
description: Discover the new features and enhancements of version 9.0.0 of Front Matter CMS, including multilingual support, Astro assets, and more.
date: 2023-08-20T09:28:11.087Z
lastmod: 2023-08-21T09:27:44.331Z
slug: ""
lastmod: 2023-12-12T15:37:11.100Z
slug: v9.0.0
type: changelog
---

Expand Down
4 changes: 2 additions & 2 deletions content/changelog/v9.3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
title: Version 9.3.0 release notes
description: Discover the features and enhancements of v9.3.0 of Front Matter CMS, Content types from Astro Content Collection, new fieldCollection field, and much more
date: 2023-10-06T11:20:22.074Z
lastmod: 2023-10-06T14:30:35.774Z
slug: ""
lastmod: 2023-12-12T15:37:16.101Z
slug: v9.3.0
type: changelog
---

Expand Down
131 changes: 131 additions & 0 deletions content/changelog/v9.4.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
---
title: Version 9.4.0 release notes
description: Learn about the new localization support, custom script enhancements, and more in the Version 9.4.0 release notes of Front Matter CMS.
date: 2023-12-12T08:32:08.859Z
lastmod: 2023-12-12T15:37:20.732Z
slug: v9.4.0
type: changelog
---

## Localization of Front Matter CMS

Now both the webviews and the extension dialogs, messages, and notifications are localized. Currently we support the following languages:

- German
- Spanish
- French
- Italian
- Japanese
- Korean
- Portuguese (Brazil)
- English

> **Important**: If a human translation is not available for the language, it will be translated using Azure Translation Services. This means that the translation might not be 100% accurate. In case you want to help us translate Front Matter CMS to your language, please check out the [localization documentation](/docs/contributing#translating-the-extension).
## Custom script enhancements

With the [@frontmatter/extensibility](https://www.npmjs.com/package/@frontmatter/extensibility) package, it is easier to create custom scripts for Front Matter CMS and it allows you to do more like asking questions to the user.

### Getting the arguments

Previously, you had to manually parse the arguments from the `process.argv` array. Now you can use the `getArguments` function from the `@frontmatter/extensibility` package.

```ts
import { ContentScript, MediaScript } from '@frontmatter/extensibility';

// In content scripts
const contentScriptArgs = ContentScript.getArguments();

// In media scripts
const mediaScriptArgs = MediaScript.getArguments();
```

> **Info**: More information can be found in the [creating a content script](/docs/custom-actions#creating-a-content-script) and [creating a media script](/docs/custom-actions#creating-a-media-script) documentation.
### Asking questions

You can now ask questions to the user when running a script. This can be done by using the `askQuestion` function from the `@frontmatter/extensibility` package.

```ts
import { MediaScript } from '@frontmatter/extensibility';

const mediaScriptArgs = MediaScript.getArguments();

const answers = mediaScriptArgs.answers;
if (!answers) {
MediaScript.askQuestions([{
name: "width",
message: "What is the width of the image?",
default: image.width
}]);
return;
}

const width = answers.width;

// Do something with the width
```

> **Info**: More information can be found in the [asking questions to users](/docs/custom-actions#asking-questions-to-users) documentation.
## Scheduled content

You can now filter and group the content dashboard by scheduled content. This allows you to see which content is scheduled to be published in the future.

![Scheduled content](/releases/v9.4.0/scheduled-content.png)

## Creating sub-content

When creating sub-content, you can now select the parent folder. This allows you to create you content in any folder you want.

You can enable this feature on the content type by setting the `allowAsSubContent` or `isSubContent` property to `true`.

> **Info**: More information can be found in the [creating sub-content](/docs/content-creation/content-types#creating-sub-content) documentation.
## Content type name shown in the panel

A small enhancement which we added in this release to the editor panel is the content type name in the metadata section. Now you can easily see which content type your content is using.

![Content type name](/releases/v9.4.0/content-type-name.png)

## Related issues/enhancements

### ✨ New features

- Localization implemented for the whole extension

### 🎨 Enhancements

- [#273](https://github.com/estruyf/vscode-front-matter/issues/273): Allow single value arrays to be set as a string with the `singleValueAsString` field property
- [#686](https://github.com/estruyf/vscode-front-matter/issues/686): Allow script authors to ask questions during script execution
- [#688](https://github.com/estruyf/vscode-front-matter/issues/688): Allow to show the scheduled articles in the content dashboard (filter and group)
- [#690](https://github.com/estruyf/vscode-front-matter/issues/690): Added the ability to filter values in the `contentRelationship` field
- [#700](https://github.com/estruyf/vscode-front-matter/issues/700): Added the `{{pathToken.relPath}}` placeholder for the `previewPath` property
- [#706](https://github.com/estruyf/vscode-front-matter/issues/706): Show the error of scripts failing in the Front Matter output panel
- [#709](https://github.com/estruyf/vscode-front-matter/issues/709): Take "where clause" into account on content creation
- [#710](https://github.com/estruyf/vscode-front-matter/issues/710): Hide child field when parent field its "when clause" is not met, also remove the fields from the content
- [#713](https://github.com/estruyf/vscode-front-matter/issues/713): Add the ability to always use quotes around string values in front matter
- [#722](https://github.com/estruyf/vscode-front-matter/issues/722): Allow to create sub-content which shows a dialog to select the parent folder

### ⚡️ Optimizations

- Dashboard layout grid optimizations
- Added the content-type name to the metadata section in the panel
- New implementation of the combobox for the `contentRelationship` field

### 🐞 Fixes

- [#685](https://github.com/estruyf/vscode-front-matter/issues/685): Fix when using non-string values in the tag picker
- [#691](https://github.com/estruyf/vscode-front-matter/issues/691): Silent authentication retrieval for GitHub sponsors
- [#694](https://github.com/estruyf/vscode-front-matter/issues/694): Start terminal session from the folder where the `frontmatter.json` file is located
- [#696](https://github.com/estruyf/vscode-front-matter/issues/696): Close the local server terminal on restart
- [#699](https://github.com/estruyf/vscode-front-matter/issues/699): Changing border theme variable for the dashboard header
- [#703](https://github.com/estruyf/vscode-front-matter/issues/703): Fix retrieval of Astro Collections for `pnpm` projects
- [#704](https://github.com/estruyf/vscode-front-matter/issues/704): Fix `zod` schema script for optional fields
- [#707](https://github.com/estruyf/vscode-front-matter/issues/707): Fix `clearEmpty` issue with `draft` and `boolean` fields which are by default set to `true`
- [#711](https://github.com/estruyf/vscode-front-matter/issues/711): Fix in character mapping in the slug field
- [#712](https://github.com/estruyf/vscode-front-matter/issues/712): Keep the search context when deleting media files
- [#714](https://github.com/estruyf/vscode-front-matter/issues/714): Fix for taxonomy filtering from taxonomy view to content view
- [#717](https://github.com/estruyf/vscode-front-matter/issues/717): Fix in loading yaml data files
- [#718](https://github.com/estruyf/vscode-front-matter/issues/718): Fix JSON schema for the `frontMatter.panel.actions.disabled` setting
- [#719](https://github.com/estruyf/vscode-front-matter/issues/719): Fix styling on data view with objects views
59 changes: 58 additions & 1 deletion content/docs/content-creation/content-type.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Content types
slug: content-creation/content-types
description: null
date: 2022-03-14T08:43:17.483Z
lastmod: 2023-09-11T07:47:18.146Z
lastmod: 2023-12-08T09:13:41.283Z
weight: 200.1
---

Expand Down Expand Up @@ -128,6 +128,8 @@ For the content type you can configure the following properties:
| `postScript` | `string` | An optional post script that can be used after new content creation. In order to use this, you will have to set the value to the ID of your [content script][04] | `null` |
| `previewPath` | `string` | Defines a custom preview path for the content type. When the preview path is not set, the value from the [`frontMatter.preview.pathName`][03] setting will be used | `null` |
| `template` | `string` | Specify a path to a template file that will be used when creating new content with the content type | `null` |
| `allowAsSubContent` | `boolean` | Allow the content type to be used as sub-content | `false` |
| `isSubContent` | `boolean` | Defines the content type as sub-content | `false` |

## Define your own type

Expand Down Expand Up @@ -180,6 +182,61 @@ type: documentation

> **Fields**: Check out the [fields][05] section to learn which fields are supported.
## Creating sub-content

By default, when you create new content, it will always be created in one of your defined folders
in the `frontMatter.content.pageFolders` setting.

In some cases, you want to create a hierarchy of content. For example, you want to create a
documentation site, where each topic has its own folder. The starting point is a page bundle which
contains the `index.md` file and all the related topics are created as separate files in the same
folder.

To support this, you can now make use of the `allowAsSubContent` and `isSubContent` properties on
your content type.

### Allow as sub-content

The `allowAsSubContent` property is intended to be used for content types with a page bundle
(`pageBundle: true`). When you set this property to `true`, during the content creation, you will be
able to choose if you want to create content as parent or sub-content.

```json {{ "title": "Using the allowAsSubContent property" }}
{
"frontMatter.taxonomy.contentTypes": [
{
"name": "parent",
"pageBundle": true,
"allowAsSubContent": true,
"fields": [
...
]
}
]
}
```

### Is sub-content

The `isSubContent` property is intended to be used for content types which will always be created as
sub-content. When you set this property to `true`, during the content creation, you be able to
select the parent folder.

```json {{ "title": "Using the isSubContent property" }}
{
"frontMatter.taxonomy.contentTypes": [
{
"name": "child",
"pageBundle": true,
"isSubContent": true,
"fields": [
...
]
}
]
}
```

## Using a template with the content type

When creating content that requires a pre-defined structure, you can use the `template` property.
Expand Down
8 changes: 7 additions & 1 deletion content/docs/content-creation/fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Fields
slug: content-creation/fields
description: null
date: 2022-03-14T08:42:21.626Z
lastmod: 2023-12-01T09:24:51.920Z
lastmod: 2023-12-08T08:57:08.344Z
weight: 200.2
---

Expand Down Expand Up @@ -447,6 +447,8 @@ When the tag is created, you will be able to re-use it for other content.

- `taxonomyLimit`: Defines the maximum number of items that can be selected. By default set to `0`
which allows unlimited items to be selected.
- `singleValueAsString`: When set to `true`, a single value will be added as a string value instead
of an array.

> **Info**: When a limit is defined, this will get reflected in the UI as well:
Expand Down Expand Up @@ -479,6 +481,8 @@ The `categories` field is similar to the [tags][09] field. Categories are also s

- `taxonomyLimit`: Defines the maximum number of items that can be selected. By default set to `0`
which allows unlimited items to be selected.
- `singleValueAsString`: When set to `true`, a single value will be added as a string value instead
of an array.

```json {{ "title": "Usage" }}
{
Expand Down Expand Up @@ -506,6 +510,8 @@ taxonomy values and structure.
which allows unlimited items to be selected.
- `taxonomyId`: Set the id of your custom taxonomy definition defined in the
`frontMatter.taxonomy.customTaxonomy` setting.
- `singleValueAsString`: When set to `true`, a single value will be added as a string value instead
of an array.

### Custom taxonomy

Expand Down
Loading

1 comment on commit 5d9cd08

@vercel
Copy link

@vercel vercel bot commented on 5d9cd08 Dec 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.