Skip to content

Commit ad2d769

Browse files
committed
update commands
1 parent 233146f commit ad2d769

File tree

2 files changed

+46
-66
lines changed

2 files changed

+46
-66
lines changed

content/docs/commands.md

Lines changed: 38 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Commands
33
slug: commands
44
description: null
55
date: 2021-08-30T16:13:00.546Z
6-
lastmod: 2024-02-26T17:54:13.589Z
6+
lastmod: 2024-02-26T18:39:22.844Z
77
weight: 1100
88
---
99

@@ -49,74 +49,41 @@ the welcome screen will be shown.
4949

5050
ID: `frontMatter.dashboard`
5151

52-
### Diagnostic logging
53-
54-
Opens a virtual Markdown document with detailed information about your Front Matter configuration.
55-
56-
ID: `frontMatter.diagnostics`
57-
58-
### Insert media into your content
59-
60-
Allows you to quickly insert an media reference in the Markdown file.
61-
62-
ID: `frontMatter.insertMedia`
63-
64-
### Insert snippet into your content
65-
66-
Allows you to quickly insert a snippet in the Markdown file.
67-
68-
ID: `frontMatter.insertSnippet`
69-
70-
### Create category
71-
72-
Creates a new category and allows you to include it into your post automatically.
73-
74-
ID: `frontMatter.createCategory`
52+
### Open media dashboard
7553

76-
### Create tag
54+
Opens the media dashboard with all your media files.
7755

78-
Creates a new tag and allows you to include it into your post automatically.
56+
ID: `frontMatter.dashboard.media`
7957

80-
ID: `frontMatter.createTag`
58+
### Open snippet dashboard
8159

82-
### Insert categories
60+
Opens the snippet dashboard with all your snippets.
8361

84-
Inserts a selected categories into the front matter of your article/post/... - When using this
85-
command, the Front Matter panel opens and focuses on the specified type.
62+
ID: `frontMatter.dashboard.snippets`
8663

87-
ID: `frontMatter.insertCategories`
64+
### Open data dashboard
8865

89-
### Insert tags
66+
Opens the data dashboard with all your data files.
9067

91-
Inserts a selected tags into the front matter of your article/post/... - When using this command,
92-
the Front Matter panel opens and focuses on the specified type.
68+
ID: `frontMatter.dashboard.data`
9369

94-
ID: `frontMatter.insertTags`
70+
### Open taxonomy dashboard
9571

96-
### Export all tags & categories to your settings
72+
Opens the taxonomy dashboard with all your categories and tags.
9773

98-
Export all the already used tags & categories in your articles/posts/... to your user settings.
74+
ID: `frontMatter.dashboard.taxonomy`
9975

100-
ID: `frontMatter.exportTaxonomy`
101-
102-
### Remap or remove tag/category in all articles
103-
104-
This command helps you quickly update/remap or delete a tag or category in your markdown files. The
105-
extension will ask you to select the taxonomy type (tag or category), the old taxonomy value, and
106-
the new one (leave the input field blank to remove the tag/category).
76+
### Insert media into your content
10777

108-
> **Info**: Once the remapping/deleting process completes, your VS Code settings update with all new
109-
> taxonomy tags/categories.
78+
Allows you to quickly insert an media reference in the Markdown file.
11079

111-
ID: `frontMatter.remap`
80+
ID: `frontMatter.insertMedia`
11281

113-
### Create a template from current file
82+
### Insert snippet into your content
11483

115-
This command allows you to create a new template from the current open Markdown file. It will ask
116-
you for the name of the template and if you want to keep the current file its content in the
117-
template.
84+
Allows you to quickly insert a snippet in the Markdown file.
11885

119-
ID: `frontMatter.createTemplate`
86+
ID: `frontMatter.insertSnippet`
12087

12188
### Create new content from defined content type or template
12289

@@ -128,6 +95,16 @@ templates.
12895
12996
ID: `frontMatter.createContent`
13097

98+
### Create new translation
99+
100+
This command allows you to create a new translation for the current content if the
101+
multilingual feature is enabled.
102+
103+
> **Info**: More information about the multilingual feature can be found in the
104+
> [multilingual documentation](/docs/content-creation/multilingual).
105+
106+
ID: `frontMatter.i18n.create`
107+
131108
### Generate slug based on content title
132109

133110
This command generates a clean slug for your content. It removes known stop words, punctuations, and
@@ -149,24 +126,22 @@ Open the site preview of your content in VS Code.
149126

150127
ID: `frontMatter.preview`
151128

152-
### Promote settings from local to team level
153-
154-
This command allows you to promote all local settings from within your `.vscode/settings.json` file
155-
to be promoted to the projects team configuration `frontmatter.json` file.
156-
157-
ID: `frontMatter.promoteSettings`
158-
159129
### Refresh the settings
160130

161131
This command allows you to refresh the settings from the `frontmatter.json` file. This is useful
162132
when you have updated the settings manually and want to reload them.
163133

164134
ID: `frontMatter.settings.refresh`
165135

166-
## Removed commands
136+
### Clear cache
167137

168-
### Set current date
138+
Clears the CMS cache, this removes all processed pages and data from the cache so that
139+
the whole cache can be rebuilt.
169140

170-
This command has been removed, as it became obsolete since the introduction of Content Types.
141+
ID: `frontMatter.cache.clear`
142+
143+
### Diagnostic logging
144+
145+
Opens a virtual Markdown document with detailed information about your Front Matter configuration.
171146

172-
ID: `frontMatter.setDate`
147+
ID: `frontMatter.diagnostics`

scripts/verify-commands.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,21 @@ const core = require("@actions/core");
2929

3030
const pkg = JSON.parse(contents);
3131
const commands = pkg.contributes.commands;
32-
const commandKeys = commands.map((c) => c.command);
32+
const commandPalette = pkg.contributes.menus.commandPalette;
33+
const commandKeys = commands.map((c) => c.command).sort();
3334

3435
const commandsPath = path.resolve(__dirname, "../content/docs/commands.md");
3536
const commandsFile = fs.readFileSync(commandsPath, "utf8");
3637

3738
const missingCommands = [];
3839

3940
for (const key of commandKeys) {
41+
const cp = commandPalette.find((c) => c.command === key);
42+
43+
if (cp.when === "false") {
44+
continue;
45+
}
46+
4047
if (!commandsFile.includes(key)) {
4148
missingCommands.push(key);
4249
}
@@ -47,7 +54,5 @@ const core = require("@actions/core");
4754
.addHeading(`Missing commands`)
4855
.addRaw(`\n ${missingCommands.map((s) => `- ${s}\n`).join("")}`)
4956
.write();
50-
51-
core.setFailed(`Missing settings: ${missingCommands.join(", ")}`);
5257
}
5358
})();

0 commit comments

Comments
 (0)