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

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

Closed
landure opened this issue May 30, 2022 · 10 comments
Labels
enhancement New feature or request Project: v8.0.0
Projects

Comments

@landure
Copy link

landure commented May 30, 2022

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
@landure landure added the bug Something isn't working label May 30, 2022
@estruyf
Copy link
Owner

estruyf commented May 30, 2022

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?

@landure
Copy link
Author

landure commented May 30, 2022

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.
.

@estruyf
Copy link
Owner

estruyf commented May 31, 2022

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?

@landure
Copy link
Author

landure commented May 31, 2022

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.

@estruyf
Copy link
Owner

estruyf commented May 31, 2022

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.

@landure
Copy link
Author

landure commented May 31, 2022

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.

@estruyf
Copy link
Owner

estruyf commented May 31, 2022

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

@estruyf
Copy link
Owner

estruyf commented Jun 1, 2022

@landure would this view make it easier?

image

@estruyf estruyf added this to In progress in v8.0.0 Jun 1, 2022
@estruyf estruyf changed the title Issue: "frontMatter.content.publicFolder" is not taken in account when set in code-worskspace and frontmatter.json both Enhancement: Improve the UI to show differences between content folders and public folder Jun 1, 2022
@estruyf estruyf added enhancement New feature or request and removed bug Something isn't working labels Jun 1, 2022
@estruyf
Copy link
Owner

estruyf commented Jun 1, 2022

Released a beta version with the following view:

image

@landure
Copy link
Author

landure commented Jun 2, 2022

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

@estruyf estruyf moved this from In progress to Done in v8.0.0 Jun 9, 2022
@estruyf estruyf moved this from Done to In progress in v8.0.0 Jun 9, 2022
@estruyf estruyf moved this from In progress to Done in v8.0.0 Jun 30, 2022
@estruyf estruyf closed this as completed Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Project: v8.0.0
Projects
No open projects
Development

No branches or pull requests

2 participants