Is your feature request related to a problem? Please describe.
When updating a frontmatter configuration that is used be several projects, I have to update each project by hand.
Describe the solution you'd like
If using Git with Front Matter I would like to be able to provide the frontmatter config as an isolated Git submodule.
(Ref: see Atlassian - Git submodules)
The config is, however, partially placed in the root folder of the Front Matter project and partially in the .frontmatter folder.
By adding support for an alternate path of the frontmatter.json file in the .frontmatter folder, the complete configuration could easily be handled as a Git submodule.
Describe alternatives you've considered
A webhook or a Git Server pipeline could be set to propagate changes to known destinations, but that seems like overkill in comparison. And frontmatter projects not known would never get the new versions automatically.
Additional context
Add any other context or screenshots about the feature request here.
**Is your feature request related to a problem? Please describe.**
When updating a frontmatter configuration that is used be several projects, I have to update each project by hand.
**Describe the solution you'd like**
If using Git with Front Matter I would like to be able to provide the frontmatter config as an isolated Git submodule.
(Ref: see [Atlassian - Git submodules](https://www.atlassian.com/git/tutorials/git-submodule))
The config is, however, partially placed in the root folder of the Front Matter project and partially in the .frontmatter folder.
By adding support for an alternate path of the frontmatter.json file in the .frontmatter folder, the complete configuration could easily be handled as a Git submodule.

**Describe alternatives you've considered**
A webhook or a Git Server pipeline could be set to propagate changes to *known* destinations, but that seems like overkill in comparison. And frontmatter projects not known would never get the new versions automatically.
**Additional context**
Add any other context or screenshots about the feature request here.
<!-- github-sync-id:1527162757 -->
It allows you to define a file that can be located in a folder or online. That should work with your use-case I believe. The only thing you need to add, in that case, is the frontmatter.json file with:
Thanks, @DennisL68 for this idea. Would it work with the following enhancement: https://github.com/estruyf/vscode-front-matter/issues/407 ?
It allows you to define a file that can be located in a folder or online. That should work with your use-case I believe. The only thing you need to add, in that case, is the `frontmatter.json` file with:
```json
{
"$schema": "https://beta.frontmatter.codes/frontmatter.schema.json",
"frontMatter.extends": [
"./.frontmatter/submodule.json"
]
}
```
<!-- github-comment-id:1414274754 -->
Submodules in git works "the other way around". They are subfolders in the git repo that are actually controller by another repo.
The frontmatter.json must in that case be placed within the .frontmatter folder (that can then be handled as a submodule).
When working with git you can't make sure external references are available. All files needs to be placed locally and each repo have it's own point of origin.
graph TD
A(Frontmatter - Git Origin)
B[Project with Frontmatter]
C[Frontmatter submodule]
D[Project - Git Origin]
subgraph Local Folder
B --o C
end
A --->|Git Pull/Push| C
D -->|Git Pull/Push| B
Ok, no. Not really.
Submodules in git works "the other way around". They are subfolders in the git repo that are actually controller by another repo.
The frontmatter.json must in that case be placed within the `.frontmatter` folder (that can then be handled as a submodule).
When working with git you can't make sure external references are available. All files needs to be placed locally and each repo have it's own point of origin.
```mermaid
graph TD
A(Frontmatter - Git Origin)
B[Project with Frontmatter]
C[Frontmatter submodule]
D[Project - Git Origin]
subgraph Local Folder
B --o C
end
A --->|Git Pull/Push| C
D -->|Git Pull/Push| B
```
<!-- github-comment-id:1430301226 -->
@DennisL68 this is indeed what the extend is actually doing. You can add a submodule in any folder for instance a config folder.
In the frontmatter.json file, you just reference the config/<file>.
This means, that in your project with Front Matter, you will have to put the config/<file> reference in the frontmatter.json file. In your submodule, you can add all the configuration you want.
@DennisL68 this is indeed what the extend is actually doing. You can add a submodule in any folder for instance a `config` folder.
In the `frontmatter.json` file, you just reference the `config/<file>`.
This means, that in your project with Front Matter, you will have to put the `config/<file>` reference in the `frontmatter.json` file. In your submodule, you can add all the configuration you want.
<!-- github-comment-id:1430941410 -->
Ok, so you are saying that the Frontmatter.json can be left empty and refer all settings to what's stored within the .Frontmatter folder?
Is it possible to have Frontmatter look for that file within the .frontmatter folder first and then, as a fallback, check the root folder of the Frontmatter project?
Then git submodules would be supported regardless how you chose to structure your Frontmatter settings...
Ok, so you are saying that the Frontmatter.json can be left empty and refer all settings to what's stored within the .Frontmatter folder?
Is it possible to have Frontmatter look for that file within the .frontmatter folder first and then, as a fallback, check the root folder of the Frontmatter project?
Then git submodules would be supported regardless how you chose to structure your Frontmatter settings...
<!-- github-comment-id:1430990612 -->
The only thing you should have in your `frontmatter.json` would be the following config:
```json
{
"$schema": "https://frontmatter.codes/frontmatter.schema.json",
"frontMatter.extends": [
"./.frontmatter/config.json"
]
}
```
The rest can then be done from your submodule.
<!-- github-comment-id:1431007469 -->
But you are still storing a part of the Frontmatter settings (the referral) outside of the git sub module (i.e. the .Frontmatter folder).
That means that you need to
Clone the submodule
Change Frontmatter.json to use the submodule
If Frontmatter would start with looking for Frontmatter.json within the .Frontmatter folder (I.e. the git submodule), you only need to clone the git repo as a submodule and you are all set :)
Yes, that will work :)
But you are still storing a part of the Frontmatter settings (the referral) outside of the git sub module (i.e. the .Frontmatter folder).
That means that you need to
1. Clone the submodule
2. Change Frontmatter.json to use the submodule
If Frontmatter would start with looking for Frontmatter.json within the .Frontmatter folder (I.e. the git submodule), you only need to clone the git repo as a submodule and you are all set :)
<!-- github-comment-id:1431059401 -->
The last request to allow you to place the `frontmatter.json` file in a sub-directory and load it, will come in the next version. https://github.com/estruyf/vscode-front-matter/issues/676
<!-- github-comment-id:1744855835 -->
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.
Is your feature request related to a problem? Please describe.
When updating a frontmatter configuration that is used be several projects, I have to update each project by hand.
Describe the solution you'd like
If using Git with Front Matter I would like to be able to provide the frontmatter config as an isolated Git submodule.
(Ref: see Atlassian - Git submodules)
The config is, however, partially placed in the root folder of the Front Matter project and partially in the .frontmatter folder.
By adding support for an alternate path of the frontmatter.json file in the .frontmatter folder, the complete configuration could easily be handled as a Git submodule.
Describe alternatives you've considered
A webhook or a Git Server pipeline could be set to propagate changes to known destinations, but that seems like overkill in comparison. And frontmatter projects not known would never get the new versions automatically.
Additional context
Add any other context or screenshots about the feature request here.
Thanks, @DennisL68 for this idea. Would it work with the following enhancement: https://github.com/estruyf/vscode-front-matter/issues/407 ?
It allows you to define a file that can be located in a folder or online. That should work with your use-case I believe. The only thing you need to add, in that case, is the
frontmatter.jsonfile with:Ok, no. Not really.
Submodules in git works "the other way around". They are subfolders in the git repo that are actually controller by another repo.
The frontmatter.json must in that case be placed within the
.frontmatterfolder (that can then be handled as a submodule).When working with git you can't make sure external references are available. All files needs to be placed locally and each repo have it's own point of origin.
@DennisL68 this is indeed what the extend is actually doing. You can add a submodule in any folder for instance a
configfolder.In the
frontmatter.jsonfile, you just reference theconfig/<file>.This means, that in your project with Front Matter, you will have to put the
config/<file>reference in thefrontmatter.jsonfile. In your submodule, you can add all the configuration you want.Ok, so you are saying that the Frontmatter.json can be left empty and refer all settings to what's stored within the .Frontmatter folder?
Is it possible to have Frontmatter look for that file within the .frontmatter folder first and then, as a fallback, check the root folder of the Frontmatter project?
Then git submodules would be supported regardless how you chose to structure your Frontmatter settings...
The only thing you should have in your
frontmatter.jsonwould be the following config:The rest can then be done from your submodule.
Yes, that will work :)
But you are still storing a part of the Frontmatter settings (the referral) outside of the git sub module (i.e. the .Frontmatter folder).
That means that you need to
If Frontmatter would start with looking for Frontmatter.json within the .Frontmatter folder (I.e. the git submodule), you only need to clone the git repo as a submodule and you are all set :)
The last request to allow you to place the
frontmatter.jsonfile in a sub-directory and load it, will come in the next version. https://github.com/estruyf/vscode-front-matter/issues/676