Skip to content

Commit fc736aa

Browse files
committed
Updated slug docs
1 parent 6ee645a commit fc736aa

File tree

4 files changed

+38
-29
lines changed

4 files changed

+38
-29
lines changed

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Content types
33
slug: content-creation/content-types
44
description: Learn how to define content types in Front Matter CMS
55
date: 2022-03-14T08:43:17.483Z
6-
lastmod: 2024-02-22T17:36:18.884Z
6+
lastmod: 2024-02-24T13:18:45.853Z
77
weight: 200.21
88
---
99

@@ -119,21 +119,21 @@ The metadata section on the editor panel will render the following fields:
119119

120120
For the content type you can configure the following properties:
121121

122-
| Property | Type | Description | Default value |
123-
| ----------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------- |
124-
| `name` | `string` | Name of the content type | `""` |
125-
| `clearEmpty` | `boolean` | Clears the fields from the front matter section if empty | `false` |
126-
| `defaultFileName` | `string` | Default file name to use when creating new content | `index` |
127-
| `fields` | `array` | Check the [supported field types][02] | `[]` |
128-
| `filePrefix` | `string` | Defines a prefix for the file name | `null` |
129-
| `fileType` | Enum: `md, mdx, markdown, <your choice>` | File type of for the content type you define. The type will be used to create the file when creating content. | `md` |
130-
| `pageBundle` | `boolean` | If set to true, the content will be created as a page bundle (folder) | `false` |
131-
| `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` |
132-
| `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` |
133-
| `template` | `string` | Specify a path to a template file that will be used when creating new content with the content type | `null` |
134-
| `allowAsSubContent` | `boolean` | Allow the content type to be used as sub-content | `false` |
135-
| `isSubContent` | `boolean` | Defines the content type as sub-content | `false` |
136-
| `slugTemplate` | `boolean` | Defines the template for the `slug` | `{{title}}` |
122+
| Property | Type | Description | Default value |
123+
| ----------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------- |
124+
| `name` | `string` | Name of the content type | `""` |
125+
| `clearEmpty` | `boolean` | Clears the fields from the front matter section if empty | `false` |
126+
| `defaultFileName` | `string` | Default file name to use when creating new content | `index` |
127+
| `fields` | `array` | Check the [supported field types][02] | `[]` |
128+
| `filePrefix` | `string` | Defines a prefix for the file name | `null` |
129+
| `fileType` | Enum: `md, mdx, markdown, <your choice>` | File type of for the content type you define. The type will be used to create the file when creating content. | `md` |
130+
| `pageBundle` | `boolean` | If set to true, the content will be created as a page bundle (folder) | `false` |
131+
| `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` |
132+
| `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` |
133+
| `template` | `string` | Specify a path to a template file that will be used when creating new content with the content type | `null` |
134+
| `allowAsSubContent` | `boolean` | Allow the content type to be used as sub-content | `false` |
135+
| `isSubContent` | `boolean` | Defines the content type as sub-content | `false` |
136+
| `slugTemplate` | `boolean` | Defines the template for the `slug` | `{{title}}` |
137137

138138
## Define your own type
139139

content/docs/content-creation/placeholders.md

Lines changed: 8 additions & 6 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-22T17:35:26.291Z
6+
lastmod: 2024-02-24T13:18:09.798Z
77
weight: 200.51
88
---
99

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

3030
## Special placeholders
3131

32-
| Placeholder | Description | Works for |
33-
| ----------------------- | ---------------------------------------------------------- | ----------------------------------------------------- |
34-
| `{{fm.<field name>}}` | The value of the field in the front matter | `slugTemplate` and `previewPath` properties. |
35-
| `{{pathToken.<index>}}` | The value of the path token at the index | `previewPath` on the page folder or the content-type. |
36-
| `{{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+
| `{{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. |
3738

3839
### Example 1
3940

@@ -234,3 +235,4 @@ follows:
234235
<!-- Link References -->
235236

236237
[01]: /docs/custom-actions/#content-script
238+
[02]: /docs/content-creation/slug

content/docs/content-creation/slug.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Slug
33
slug: content-creation/slug
44
description: Learn how you can dynamically generate slugs for your pages in Front Matter CMS
55
date: 2024-02-13T09:28:37.205Z
6-
lastmod: 2024-02-22T17:35:42.410Z
6+
lastmod: 2024-02-24T13:14:13.333Z
77
weight: 200.61
88
---
99

@@ -29,6 +29,10 @@ slug: sample-page-title
2929

3030
> **Info**: The extension only supports English stopwords.
3131
32+
> **Important**: If you do not define a slug in the content type, the slug will be
33+
> derived from the `frontMatter.taxonomy.slugTemplate` setting. If the setting is
34+
> not defined, the page name will be used as the slug.
35+
3236
## Custom slug
3337

3438
You can define a custom slug for your pages and it can be defined on global
@@ -46,8 +50,9 @@ actual values when creating a new page.
4650
}
4751
```
4852

49-
> **Info**: The `{{title}}` placeholder in the slug template will be replaced with
50-
> what you typically get from the default slug.
53+
> **Info**: When using the `{{title}}` placeholder in the slug template it will be
54+
> automatically converted to lowercase and spaces will be replaced with hyphens.
55+
> To have a SEO friendly URL, you can use the `{{seoTitle}}` placeholder instead.
5156
5257
### Per content type
5358

content/docs/settings/available-settings.md

Lines changed: 6 additions & 4 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-22T12:27:07.174Z
6+
lastmod: 2024-02-24T13:16:18.482Z
77
weight: 1100.2
88
---
99

@@ -717,11 +717,12 @@ Specify a suffix for the slug.
717717

718718
### frontMatter.taxonomy.slugTemplate
719719

720-
Specify the template for the slug. If you use `{{title}}`, it will create a clean slug based on the
721-
title.
720+
Specify the template for the slug.
722721

723722
- Type: `string`
724-
- Default: `{{title}}`
723+
- Default: ``
724+
725+
> **Info**: More information on how to use it can be found in the [slug][26] section.
725726
726727
### frontMatter.taxonomy.tags
727728

@@ -841,3 +842,4 @@ This setting is used to define the modified date field of your articles.
841842
[23]: /docs/dashboard/content-view#filters
842843
[24]: /docs/dashboard/media-view#metadata
843844
[25]: /docs/dashboard/media-view#define-the-media-folder
845+
[26]: /docs/content-creation/slug

0 commit comments

Comments
 (0)