Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
davidsneighbour opened this issue Mar 31, 2024 · 5 comments
Labels
bug Something isn't working In BETA The current task is available for testing in the BETA version. v10.2.0 Project: v10.2.0

Comments

@davidsneighbour
Copy link

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.

@davidsneighbour davidsneighbour added the bug Something isn't working label Mar 31, 2024
@davidsneighbour
Copy link
Author

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": []
}

@estruyf
Copy link
Owner

estruyf commented Apr 1, 2024

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.

@davidsneighbour
Copy link
Author

davidsneighbour commented Apr 1, 2024

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?

@estruyf
Copy link
Owner

estruyf commented Apr 1, 2024

I know 😄

@project-labels project-labels bot added v10.2.0 Project: v10.2.0 Backlog This item hasn't been started labels Apr 30, 2024
@project-labels project-labels bot added In progress This is actively being worked on and removed Backlog This item hasn't been started labels May 23, 2024
@estruyf
Copy link
Owner

estruyf commented May 23, 2024

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?

estruyf added a commit that referenced this issue May 23, 2024
estruyf added a commit that referenced this issue May 23, 2024
@project-labels project-labels bot added In BETA The current task is available for testing in the BETA version. and removed In progress This is actively being worked on labels May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working In BETA The current task is available for testing in the BETA version. v10.2.0 Project: v10.2.0
Projects
None yet
Development

No branches or pull requests

2 participants