diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a222fd9..ab18dada 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ - [#349](https://github.com/estruyf/vscode-front-matter/issues/349): New `slug` field which allows you to manage the slug of your post from the Front Matter panel - [#350](https://github.com/estruyf/vscode-front-matter/issues/350): New `previewPath` property for the `frontMatter.content.pageFolders` setting. This allows you to specify a section prefix for all content created in that directory. - [#351](https://github.com/estruyf/vscode-front-matter/issues/351): New `template` property for content types which allows you to combine templates and content types for content creation +- [#353](https://github.com/estruyf/vscode-front-matter/issues/353): Add the default content type on project initialization ### 🐞 Fixes diff --git a/src/commands/Project.ts b/src/commands/Project.ts index e488f116..8e708f4c 100644 --- a/src/commands/Project.ts +++ b/src/commands/Project.ts @@ -1,3 +1,4 @@ +import { DEFAULT_CONTENT_TYPE } from './../constants/ContentType'; import { Telemetry } from './../helpers/Telemetry'; import { workspace, Uri } from "vscode"; import { join } from "path"; @@ -6,7 +7,7 @@ import { Notifications } from "../helpers/Notifications"; import { Template } from "./Template"; import { Folders } from "./Folders"; import { FrameworkDetector, Logger, Settings } from "../helpers"; -import { SETTING_CONTENT_DEFAULT_FILETYPE, TelemetryEvent } from "../constants"; +import { SETTING_CONTENT_DEFAULT_FILETYPE, SETTING_TAXONOMY_CONTENT_TYPES, TelemetryEvent } from "../constants"; import { SettingsListener } from '../listeners/dashboard'; export class Project { @@ -35,6 +36,9 @@ categories: [] try { Settings.createTeamSettings(); + // Add the default content type + Settings.update(SETTING_TAXONOMY_CONTENT_TYPES, [DEFAULT_CONTENT_TYPE], true); + if (sampleTemplate !== undefined) { await Project.createSampleTemplate(); } else {