Closed nkuehn closed 4 years ago
Should I look into this?
@davifantasia result from a quick call with Nicola: We'll try to use gatsby's code shadowing to simply override the files locally using gatsby component shadowing.
It means duplicating them for the 6 sites but that's good enough for the migration phase.
@emmenko FYI my research status:
commercetools-docs
repo which is practical anyways because it allows to centrally preconfigure themes and centrally set the version. I configured the filesystem source again there, which works but it does not override the data but adds new menu entries etc. That's nice but was not the goal. So we'll have to do something in the actual theme, the simplest form would be to pass an option that allows to disable the theme's 'internalConfigurationData' loading.
Have you tried simply creating a top-menu.yaml
in src/data
?
The yaml transformer should be able to pick it up and assign it to the TopMenu
schema.
Yes, that's what I did. But as said in the above comment, the YAML plugin adds the menu entries to the existing menu entries, it does not replace them.
That's because the YAML source plugin is hardwired to require an array as the top level stucture of the yaml files whose entries are then automatically becoming nodes in a GraphQL type of the file name. If if finds two same named files it seems to just add the entries.
So to really override you have to stop the theme from providing its own files.
PS: if you mean "just" putting it into the website folder? That leads to nothing, the loader is explicitly configured to look into __dirname
, that was the whole point of it originally
No the source plugin is configured to load data
folders both in the theme and in the website.
Yes, it adds the new entries to the existing one. I thought this was enough, or do you want to replace some of the menu items?
One option could be to allow a custom-top-menu.yaml
in the website src/data
, and instruct the theme to render that, if available. We could probably do that in gatsby-node.js
when constructing their related nodes.
OK, back to zero and do not take 500 $. The use case:
I have an idea, let me try something
As already discussed at the beginning of the kit implementation, we are now nearing go live and it turns out we need to be able to configure the top nav and footer links - or at least toggle between "current" and "next" in the site options.
Reasons:
We did discuss live download from a central location, that's an option but i would already be very happy with being able to pull the data from a file or a file in another package.