As some want to keep the root of their project clean, it would be helpful to allow the frontmatter.json file to live within a subfolder.
Important
: for workspaces, it would be advised to keep the frontmatter.json file in the root of the SSG project as it is used for Front Matter to know the start location.
As some want to keep the root of their project clean, it would be helpful to allow the `frontmatter.json` file to live within a subfolder.
> **Important**: for workspaces, it would be advised to keep the `frontmatter.json` file in the root of the SSG project as it is used for Front Matter to know the start location.
<!-- github-sync-id:1908974160 -->
In this context, hope to
- ’frontMatter.content.pageFolders’ can be relative to this sub-folder(where frontmatter.json is located)
- Server(e.g. `hugo`) start at this sub-folder
```
worskpace/
└── doc
├── content
├── frontmatter.json
└── hugo-config.toml
```
<!-- github-comment-id:1773704261 -->
@n-arakawa, I see that you are using a workspace. Currently, that is not supported, as the extension will search for the frontmatter.json file to decide where the SSG project is located. Looking through sub-folders of all workspace folders complicates it a bit or could end up using the wrong folder. More work is required for that.
Feel free to open another issue for this kind of enhancement if you want to get it in the product.
@n-arakawa, I see that you are using a workspace. Currently, that is not supported, as the extension will search for the `frontmatter.json` file to decide where the SSG project is located. Looking through sub-folders of all workspace folders complicates it a bit or could end up using the wrong folder. More work is required for that.
Feel free to open another issue for this kind of enhancement if you want to get it in the product.
<!-- github-comment-id:1774603073 -->
Sorry, @n-arakawa, now I got confused too, could you share your project repository its folders, and where in the structure the frontmatter.json file is located?
Sorry, @n-arakawa, now I got confused too, could you share your project repository its folders, and where in the structure the `frontmatter.json` file is located?
<!-- github-comment-id:1777260114 -->
Frontmatter version
[9.3.0] - 2023-10-06 - Release notes
Sorry for my poor explonation.
In this case I do not use `VScode workspace.`
The folder name "workspace" in the previous post is incorrect.
I have a git repository (`repo1`) and a documentation subdirectory (i.e. `hugo-doc`).
```
repo1/
└── hugo-doc
├── config.toml
├── content
│ └── post
│ └── first_post.md
├── frontmatter.json
```
When I start `code repo1/hugo-doc`, `frontmatter` works fine.
However if I say `code repo1`
- Cannot find `content` directory. This is because `content` must exist directly under `[[workspace]]`.
- Cannnot start hugo server. This is because hugo server start at `[[workspace]]` and there is no hugo config(`config.toml`)
I hope to:
- Set "content" relative to "frontmatter.json"
- Start hugo server in `frontmatter.json` directory
frontmatter.json
```
{
"$schema": "https://frontmatter.codes/frontmatter.schema.json",
"frontMatter.framework.id": "hugo",
"frontMatter.content.publicFolder": "static",
"frontMatter.preview.host": "http://localhost:1313",
"frontMatter.content.pageFolders": [{
"title": "content",
"path": "[[workspace]]/content",
"previewPath": "/{{pathToken.relPath}}/",
"contentTypes": ["post"]
}],
"frontMatter.taxonomy.dateFormat": "yyyy-MM-dd",
"frontMatter.framework.startCommand": "hugo server -D"
}
```
Frontmatter version
[9.3.0] - 2023-10-06 - [Release notes](https://beta.frontmatter.codes/updates/v9.3.0)
<!-- github-comment-id:1780170062 -->
Front Matter is intended to start from the root project folder or a VS Code Workspace, where it will look for the folders where it can find the frontmatter.json file.
As you are opening it one level up and not using a VS Code Workspace, these checks are not passed, and that is why the [[workspace]] path will be /repo1.
I'm unsure of the best approach to support your use case, as it would complicate the logic of getting to know the start location.
Thank you, @n-arakawa. This clarifies it.
Front Matter is intended to start from the root project folder or a VS Code Workspace, where it will look for the folders where it can find the `frontmatter.json` file.
As you are opening it one level up and not using a VS Code Workspace, these checks are not passed, and that is why the `[[workspace]]` path will be `/repo1`.
I'm unsure of the best approach to support your use case, as it would complicate the logic of getting to know the start location.
<!-- github-comment-id:1780581324 -->
I understand that it's difficult to accommodate my use case.
In the short term, I'll disable FrontMatter in the repo1 workspace to suppressFolder "${folder.title} (${folder.path})" does not exist. Please remove it from the settings. notifications.
I understand that it's difficult to accommodate my use case.
In the short term, I'll disable FrontMatter in the repo1 workspace to suppress`Folder "${folder.title} (${folder.path})" does not exist. Please remove it from the settings.` notifications.
<!-- github-comment-id:1780816407 -->
@n-arakawa when you open the repo1 folder, is that because there are more folders in it that you want to work with?
@n-arakawa when you open the `repo1` folder, is that because there are more folders in it that you want to work with?
<!-- github-comment-id:1781032618 -->
is that because there are more folders in it that you want to work with?
yes. My "repo1" is not just a documentation project, it's a software project in itself. I plan to manage the documentation part of the project with vscode-front-matter.
@estruyf
> is that because there are more folders in it that you want to work with?
yes. My "repo1" is not just a documentation project, it's a software project in itself. I plan to manage the documentation part of the project with vscode-front-matter.
<!-- github-comment-id:1781950673 -->
What holds you from creating a VS Code Workspace? That way, you could open repo1 as a workspace with all the folders.
What holds you from creating a VS Code Workspace? That way, you could open `repo1` as a workspace with all the folders.
<!-- github-comment-id:1782392977 -->
Thank you for your advice!
Creating a workspace with two folders "repo1" and "repo1/hugo-doc" seems to solve the problem.
Thank you for your advice!
Creating a workspace with two folders "repo1" and "repo1/hugo-doc" seems to solve the problem.
<!-- github-comment-id:1783596805 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
As some want to keep the root of their project clean, it would be helpful to allow the
frontmatter.jsonfile to live within a subfolder.In this context, hope to
hugo) start at this sub-folder@n-arakawa, I see that you are using a workspace. Currently, that is not supported, as the extension will search for the
frontmatter.jsonfile to decide where the SSG project is located. Looking through sub-folders of all workspace folders complicates it a bit or could end up using the wrong folder. More work is required for that.Feel free to open another issue for this kind of enhancement if you want to get it in the product.
Thank you for your answer.
I may have confused
Sorry, @n-arakawa, now I got confused too, could you share your project repository its folders, and where in the structure the
frontmatter.jsonfile is located?Sorry for my poor explonation.
In this case I do not use
VScode workspace.The folder name "workspace" in the previous post is incorrect.
I have a git repository (
repo1) and a documentation subdirectory (i.e.hugo-doc).When I start
code repo1/hugo-doc,frontmatterworks fine.However if I say
code repo1contentdirectory. This is becausecontentmust exist directly under[[workspace]].[[workspace]]and there is no hugo config(config.toml)I hope to:
frontmatter.jsondirectoryfrontmatter.json
Frontmatter version
[9.3.0] - 2023-10-06 - Release notes
Thank you, @n-arakawa. This clarifies it.
Front Matter is intended to start from the root project folder or a VS Code Workspace, where it will look for the folders where it can find the
frontmatter.jsonfile.As you are opening it one level up and not using a VS Code Workspace, these checks are not passed, and that is why the
[[workspace]]path will be/repo1.I'm unsure of the best approach to support your use case, as it would complicate the logic of getting to know the start location.
I understand that it's difficult to accommodate my use case.
In the short term, I'll disable FrontMatter in the repo1 workspace to suppress
Folder "${folder.title} (${folder.path})" does not exist. Please remove it from the settings.notifications.@n-arakawa when you open the
repo1folder, is that because there are more folders in it that you want to work with?@estruyf
yes. My "repo1" is not just a documentation project, it's a software project in itself. I plan to manage the documentation part of the project with vscode-front-matter.
What holds you from creating a VS Code Workspace? That way, you could open
repo1as a workspace with all the folders.Thank you for your advice!
Creating a workspace with two folders "repo1" and "repo1/hugo-doc" seems to solve the problem.