-
-
Notifications
You must be signed in to change notification settings - Fork 87
Enhancement: Add support for allowing multiple asset locations - monorepo #548
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
Comments
I wish I could do more to help but I don't know much about this extension. I hope you remember that the key is supposed to be used to tell Frontmatter CMS what folder to put the assets in. |
I'm sorry but the |
I understand you @louiss0, but it needs to fit into the whole system. The setting you propose would work nicely when using a mono-repository, but it won't work or is a lot trickier when using a single project and wanting to specify two asset locations. Which I believe might also be an option on sites with various types of content. That is why I want to make a change that would work for both a single and a mono-repo project. I have listed the options which can be done. In my opinion, option 5 is the best of all. It would look as follows: {
"frontMatter.content.publicFolder": [
{
"title": "blog-public",
"path": "[[workspace]]/blog/public",
"publicFolders": ["blog-page"]
},
{
"title": "portfolio-public",
"path": "[[workspace]]/portfolio/public",
"publicFolders": ["portfolio-page"]
}
],
"frontMatter.content.pageFolders": [
{
"title": "blog-page",
"path": "[[workspace]]/blog/content",
"excludeSubdir": true
},
{
"title": "portfolio-page",
"path": "[[workspace]]/portfolio/content"
}
]
} |
OK, I'm wondering what software did you use to create that diagram? |
Using Mindnode for this |
I think this code snippet represents the idea that different assets can map to different folders. This is ok but I think you meant |
Have been trying option number 5 and 4. Option 5 is a huge change in architecture, but also leads to confusion on how to highlight the correct folder when you open a file. Option 4 might be easier for users to understand and the implementation/configuration is pretty easy. The Screen.Recording.2023-03-30.at.20.40.17.mov{
"frontMatter.projects": [{
"name": "eliostruyf.com",
"default": true,
"configuration": {
"frontMatter.content.pageFolders": [
{
"title": "Blog posts",
"path": "[[workspace]]/.frontmatter/content/posts"
}
],
"frontMatter.content.publicFolder": ".frontmatter/static/uploads"
}
}, {
"name": "elio.dev",
"configuration": {
"frontMatter.content.pageFolders": [
{
"title": "Portfolio",
"path": "[[workspace]]/.frontmatter/content/projects"
}
],
"frontMatter.content.publicFolder": ".frontmatter/static/social"
}
}]
} |
How have you been testing this out? You can use the Frontmatter CMS repo to test things out. I think I like Option 4. I'm biased because I'm new to this library. But I think this option allows devs to be very explicit about which project each assets are associated with. I also think this removes the boilerplate introduced by Option 5. I don't know how dangerous it is to do Option 4 because I don't know how long it has been around. But If this project is young I'd suggest you go for Option 4. I know the architectural changes are not easy but they are good if they simplify things or add much-needed flexibility. |
I have been testing it out against my blog and some of the sample sites: https://github.com/FrontMatter/project-samples Option 4 will be the easiest to understand and allows the most flexibility for future implementations. The implementation isn't that "dangerous"; without any projects defined, it will be as it is right now. |
It has been pushed to the latest beta version and can be tested by adding a similar configuration as shown above. |
Discussed in #542
Originally posted by louiss0 March 18, 2023
I have decided to talk about this as a feature idea because. I didn't think of the problem as an issue as in bug. But what I'm going to talk about is a restriction. As of today you are only allowed to use one assets folder. This is not good for people like me who use mono-repos.
Right now this is all I can do. If can could specify multiple files they would look like this.
This is what I want to do. The benefit of this is that the key could be the name of the place where each asset is displayed. The value is the folder to use. This means that pictures and where they come from can be specified in a mono-repo. even outside of a mono-repo developers can organize where each set of images are in a folder.
The text was updated successfully, but these errors were encountered: