Site mounting questions

Hey all - I have some questions for those of you that have used the Site Mounting feature. If I wanted to setup a common shared component ‘site’, and use those components across multiple sites:

  • How does it work when developing on my local machine? The mounting seems to happen on the CloudCannon servers at build time, so what happens on my machine? What would my local project structure look like?
  • Can I override components from the mounted site with files named the same on the content site? Or would they have to be named differently, and would be in addition to the mounted components?

Thanks!

3 Likes

:waving_hand:

For local development, the best match is to either use git submodules or symbolic links. In either case, you can have the components from repo A available under a prefix in repo B.

For the components, I believe the mounted site would take precedence by default. So typically you would have them named differently in the content site and both would be available.

A good alternative though is to first mount them to some unused location, and then use a prebuild script to riffle-shuffle the components into the final state you want. For example, you might site mount into remote_component_library, and then use a prebuild script to move components into the component_library folder only if they don’t already exist there.

3 Likes

Thanks Liam – I’ll have a play around with submodules/links and see how I go. That approach of shuffling things around on prebuild makes sense as well. :+1:

1 Like