Enhancement: Improve the UI to show differences between content folders and public folder #274

Closed
opened 2026-10-05 02:37:09 +02:00 by adam · 10 comments
Owner

When "frontMatter.content.publicFolder" is set both in workspace.code-workspace and frontmatter.json, the setting is not taken into account, and the Media tab of the dashboard display the contents of the "content" folder of the workspace, not the root folder (as is the default when the setting is not set).

Steps to reproduce the behavior:

  1. Add "frontMatter.content.publicFolder": "static" to frontmatter.json and workspace.code-workspace
  2. May the the path of the content folder ('content' for Hugo)
  3. Click on Dashboard : Media tab
  4. The content of 'content' are displayed, not of 'static' or of the project root (as when publicFolder is not set).

Expected behavior
A alert should be seen about the setting confusion ? and the media tab should display the 'static' folder contents..

Desktop (please complete the following information):

  • OS: Ubuntu 22.04 Jammy
  • Visual Code 1.67.2
  • Frontmatter v7.3.1
When "frontMatter.content.publicFolder" is set both in workspace.code-workspace and frontmatter.json, the setting is not taken into account, and the Media tab of the dashboard display the contents of the "content" folder of the workspace, not the root folder (as is the default when the setting is not set). Steps to reproduce the behavior: 1. Add `"frontMatter.content.publicFolder": "static"` to `frontmatter.json` and `workspace.code-workspace` 2. May the the path of the content folder ('content' for Hugo) 3. Click on Dashboard : Media tab 4. The content of 'content' are displayed, not of 'static' or of the project root (as when publicFolder is not set). **Expected behavior** A alert should be seen about the setting confusion ? and the media tab should display the 'static' folder contents.. **Desktop (please complete the following information):** - OS: Ubuntu 22.04 Jammy - Visual Code 1.67.2 - Frontmatter v7.3.1 <!-- github-sync-id:1252275232 -->
adam closed this issue 2026-10-05 02:37:10 +02:00
Author
Owner

The workspace.code-workspace and settings.json settings will override what you have set in the frontmatter.json file because these files are not always shared with the team.

I've just done some testing, but cannot reproduce the issue. What I have is the following:

  • Create a workspace
  • Add the frontMatter.content.publicFolder to the workspace.code-workspace file
  • Open the media dashboard, check if the media folder is available

Contents of frontmatter.json file

Settings

Screenshot 2022-05-30 at 09 59 26

Media dashboard output

image

Setting update in the workspace file

Settings

Screenshot 2022-05-30 at 09 59 10

Media dashboard output

image

In the workspace setting, I defined a sub-folder to show the difference and make sure it works correctly.

Questions

  1. Do you see any difference in your configuration?
  2. Would you be able to share more details of your configuration?
The `workspace.code-workspace` and `settings.json` settings will override what you have set in the `frontmatter.json` file because these files are not always shared with the team. I've just done some testing, but cannot reproduce the issue. What I have is the following: - Create a workspace - Add the `frontMatter.content.publicFolder` to the `workspace.code-workspace` file - Open the media dashboard, check if the media folder is available ## Contents of frontmatter.json file ### Settings ![Screenshot 2022-05-30 at 09 59 26](https://user-images.githubusercontent.com/2900833/170945740-7d5e4b72-abb6-4a11-993f-1eb8fcec4da8.png) ### Media dashboard output ![image](https://user-images.githubusercontent.com/2900833/170945996-3924a7ed-5bad-4232-a517-b22954ee79dc.png) ## Setting update in the workspace file ### Settings ![Screenshot 2022-05-30 at 09 59 10](https://user-images.githubusercontent.com/2900833/170946131-346cab0b-187f-4e5a-8da0-600f0df03cda.png) ### Media dashboard output ![image](https://user-images.githubusercontent.com/2900833/170946239-720e9fde-1bbc-48e9-845d-46f3e8d6d298.png) > In the workspace setting, I defined a sub-folder to show the difference and make sure it works correctly. ## Questions 1. Do you see any difference in your configuration? 2. Would you be able to share more details of your configuration? <!-- github-comment-id:1140833780 -->
Author
Owner

Hi, here is my code workspace and frontmatter.json that triggered the issue. I don't know the exact trigger for the issue, but the publicFolder setting was the one that was ignored.

code-workspace-frontmatter.zip

It is quite a playground for me , so pardon me any horror. The issue has shown up on two or three distinct computers, so it should be linked to these two files.
.

Hi, here is my code workspace and frontmatter.json that triggered the issue. I don't know the exact trigger for the issue, but the publicFolder setting was the one that was ignored. [code-workspace-frontmatter.zip](https://github.com/estruyf/vscode-front-matter/files/8798118/code-workspace-frontmatter.zip) It is quite a playground for me , so pardon me any horror. The issue has shown up on two or three distinct computers, so it should be linked to these two files. . <!-- github-comment-id:1141069677 -->
Author
Owner

Thanks @landure - Just tested your configuration on one of my projects, and I don't see anything weird happening.

  1. What does your folder structure look like?
  2. Do you have a folder named static at the root of your project?
Thanks @landure - Just tested your configuration on one of my projects, and I don't see anything weird happening. 1. What does your folder structure look like? 2. Do you have a folder named `static` at the root of your project? <!-- github-comment-id:1141725493 -->
Author
Owner

Yes, my folder structure is a relatively standard Hugo website. I played a lot with the content folder, but the root of the site is quite basic. Here it is:

  • archetypes
  • assets
  • config.yaml
  • content
  • data
  • .frontmatter
  • frontmatter.json
  • .git
  • .gitignore
  • .gitmodules
  • howto.biapy.com.code-workspace
  • .hugo_build.lock
  • layouts
  • public
  • resources
  • static
  • themes
  • .vale
  • .vale.ini
  • .vscode

Hope this help figuring where the issue came from. The folder is shared between computers using Seafile (a Dropbox self hosted equivalent), and the issue appeared on a newly install computer with a new VSCode installation after syncing the sites contents to the new computer and opening the workspace with VSCode. The real trick is that the media tab was showing the content folder instead of the root of the site sources.

Yes, my folder structure is a relatively standard Hugo website. I played a lot with the content folder, but the root of the site is quite basic. Here it is: - archetypes - assets - config.yaml - content - data - .frontmatter - frontmatter.json - .git - .gitignore - .gitmodules - howto.biapy.com.code-workspace - .hugo_build.lock - layouts - public - resources - static - themes - .vale - .vale.ini - .vscode Hope this help figuring where the issue came from. The folder is shared between computers using Seafile (a Dropbox self hosted equivalent), and the issue appeared on a newly install computer with a new VSCode installation after syncing the sites contents to the new computer and opening the workspace with VSCode. The real trick is that the media tab was showing the content folder instead of the root of the site sources. <!-- github-comment-id:1142231739 -->
Author
Owner

The media dashboard will, of course, show media files from the content folder if page bundles are used. As you can see above, folders with a C, are coming from the content folder.

That said, it still doesn't explain why in your case you don't see anything from the static folder when it is defined in your configuration.

Would you be able to give me temporary access? Feel free to contact me at elio@struyfconsulting.be to keep these things private.

The media dashboard will, of course, show media files from the content folder if page bundles are used. As you can see above, folders with a **C**, are coming from the content folder. That said, it still doesn't explain why in your case you don't see anything from the `static` folder when it is defined in your configuration. Would you be able to give me temporary access? Feel free to contact me at `elio@struyfconsulting.be` to keep these things private. <!-- github-comment-id:1142454071 -->
Author
Owner

I think I understand what happened, and why it was troubling me. I've just found my image folder in the media tab, with all my contents folders.

image

As you can see in the screenshot, there is no separation between the last folder (image folder from static (publicFolder)) and the folders (hugo sections) from content.

Since I have many sections, i completely overlooked the image folder.

So the publicFolder setting is taken into account, but since there is no visible separation for media sources (and I think that the fact that the content folder is in media should be configurable, not just automatic if page bundles are available) , i didn't find immediately the image folder.

Thank you for your help. The issue is more a UI problem than a configuration issue.

I think I understand what happened, and why it was troubling me. I've just found my image folder in the media tab, with all my contents folders. ![image](https://user-images.githubusercontent.com/1490071/171265809-016b1cd1-3375-49f1-bbcd-60209e4d4761.png) As you can see in the screenshot, there is no separation between the last folder (image folder from static (publicFolder)) and the folders (hugo sections) from content. Since I have many sections, i completely overlooked the image folder. So the publicFolder setting is taken into account, but since there is no visible separation for media sources (and I think that the fact that the content folder is in media should be configurable, not just automatic if page bundles are available) , i didn't find immediately the image folder. Thank you for your help. The issue is more a UI problem than a configuration issue. <!-- github-comment-id:1142544874 -->
Author
Owner

Oh great to hear @landure you found the issue. Let us figure out how this can be made better.

Oh great to hear @landure you found the issue. Let us figure out how this can be made better. <!-- github-comment-id:1142566902 -->
Author
Owner

@landure would this view make it easier?

image

@landure would this view make it easier? ![image](https://user-images.githubusercontent.com/2900833/171381886-0e17bf73-0da7-48ed-8468-86afb738e30e.png) <!-- github-comment-id:1143408411 -->
Author
Owner

Released a beta version with the following view:

image

Released a beta version with the following view: ![image](https://user-images.githubusercontent.com/2900833/171397728-1e871fad-c252-4844-8d92-c00fe0f2fed1.png) <!-- github-comment-id:1143504350 -->
Author
Owner

Thank you for your work, it is a clear organization.

Thank you for your work, it is a clear organization. <!-- github-comment-id:1144400438 -->
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#274