Issue: Content folder does not exists, remove it from the configuration does not work with folder setup #621

Closed
opened 2026-10-05 02:56:45 +02:00 by adam · 5 comments
Owner

I have a folder that ceased to exist, configured in .frontmatter/config/content/pagefolders/components.json.

{
  "$schema": "https://frontmatter.codes/config/content.pagefolders.schema.json",
  "title": "Components",
  "path": "[[workspace]]/../hugo-modules/modules/documentation",
  "contentTypes": ["component"]
}

FrontMatter complains that it does not exist (good) and offers to remove it or create it (good):

Selection_367x128_20240331-16:22:57

Clicking on "Remove Folder" results in a small notice for <1s about removing the setup, but the file is not modified or deleted.

.frontmatter/database/mediaDB.json seems to have been changed, but I am not sure if that is connected to this issue.

PS: the popup shows a different path because I tried some setup related to #787. The path is correctly displayed in the popup.

I have a folder that ceased to exist, configured in `.frontmatter/config/content/pagefolders/components.json`. ```json { "$schema": "https://frontmatter.codes/config/content.pagefolders.schema.json", "title": "Components", "path": "[[workspace]]/../hugo-modules/modules/documentation", "contentTypes": ["component"] } ``` FrontMatter complains that it does not exist (good) and offers to remove it or create it (good): ![Selection_367x128_20240331-16:22:57](https://github.com/estruyf/vscode-front-matter/assets/83281/b78f9fcb-e6f8-4427-835e-434c52998ca0) Clicking on "Remove Folder" results in a small notice for <1s about removing the setup, but the file is not modified or deleted. `.frontmatter/database/mediaDB.json` seems to have been changed, but I am not sure if that is connected to this issue. PS: the popup shows a different path because I tried some setup related to #787. The path is correctly displayed in the popup. <!-- github-sync-id:2216867584 -->
adam closed this issue 2026-10-05 02:56:45 +02:00
Author
Owner

Update: it DOES actually add an empty pagefolder variable to frontmatter.json:

From:

{
  "$schema": "https://frontmatter.codes/frontmatter.schema.json",
  "frontMatter.config.dynamicFilePath": "[[workspace]]/frontmatter.config.js",
  "frontMatter.site.baseURL": "https://kollitsch.dev"
}

To:

{
  "$schema": "https://frontmatter.codes/frontmatter.schema.json",
  "frontMatter.config.dynamicFilePath": "[[workspace]]/frontmatter.config.js",
  "frontMatter.site.baseURL": "https://kollitsch.dev",
  "frontMatter.content.pageFolders": []
}
Update: it DOES actually add an empty pagefolder variable to `frontmatter.json`: From: ```json { "$schema": "https://frontmatter.codes/frontmatter.schema.json", "frontMatter.config.dynamicFilePath": "[[workspace]]/frontmatter.config.js", "frontMatter.site.baseURL": "https://kollitsch.dev" } ``` To: ```json { "$schema": "https://frontmatter.codes/frontmatter.schema.json", "frontMatter.config.dynamicFilePath": "[[workspace]]/frontmatter.config.js", "frontMatter.site.baseURL": "https://kollitsch.dev", "frontMatter.content.pageFolders": [] } ``` <!-- github-comment-id:2028646960 -->
Author
Owner

Hi @davidsneighbour, at the moment, the updates to your config are only applied to the frontmatter.json files; it does not touch the ones created you've split or extended.

It would be more of an enhancement to support this, as it requires finding the location of the config file and updating it.

Hi @davidsneighbour, at the moment, the updates to your config are only applied to the `frontmatter.json` files; it does not touch the ones created you've split or extended. It would be more of an enhancement to support this, as it requires finding the location of the config file and updating it. <!-- github-comment-id:2029706137 -->
Author
Owner

I am ok with that, but the "bug" is, that IF I have a split configuration, then that popup goes into my frontmatter.json and sets the variable that might be configured in a split configuration. Do subfolder config files override the frontmatter.json or will this lead to issues down the road? Maybe a config parameter that establishes that I don't want FrontMatter to edit my config dynamically would help?

Is this:

{
  "frontMatter.content.pageFolders": []
}

ignored (or merged) if I have a .frontmatter/config/content/pagefolders/something.json file?

I am ok with that, but the "bug" is, that IF I have a split configuration, then that popup goes into my `frontmatter.json` and sets the variable that might be configured in a split configuration. Do subfolder config files override the frontmatter.json or will this lead to issues down the road? Maybe a config parameter that establishes that I don't want FrontMatter to edit my config dynamically would help? Is this: ```json { "frontMatter.content.pageFolders": [] } ``` ignored (or merged) if I have a `.frontmatter/config/content/pagefolders/something.json` file? <!-- github-comment-id:2029907587 -->
Author
Owner

I know 😄

I know 😄 <!-- github-comment-id:2029913447 -->
Author
Owner

I've been implementing a change where there is a check on setting updates. When the to-be-updated setting exists in an extended config (from frontMatter.extends, config splitting, or dynamic config), it will return a warning that it cannot do it automatically and that some manual work must be performed.

The output will tell you the setting name and the value that it was trying to update.

Image

What do you think?

I've been implementing a change where there is a check on setting updates. When the to-be-updated setting exists in an extended config (from `frontMatter.extends`, config splitting, or dynamic config), it will return a warning that it cannot do it automatically and that some manual work must be performed. The output will tell you the setting name and the value that it was trying to update. ![Image](https://github.com/estruyf/vscode-front-matter/assets/2900833/bddc0553-6233-4dc8-bf24-a33f6e17e3b6) What do you think? <!-- github-comment-id:2127584564 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/vscode-front-matter#621