decap-cms
decap-cms copied to clipboard
Separate CMS for each Gatsby website in a monorepo
Describe the bug I've been working to configure a unique CMS for each Gatsby website in a monorepo on Github and can't find how to do that. I've copied the websites over from their previous locations in individual repos and updated the Git references in Netlify / Build / Deploy and Netlify / Identify dashboards but they still seem broken despite websites building and deploying successfully on Netlify.
To Reproduce Add multiple websites to a single repo, try to configure a unique Netlify CMS on each. Github login button (though enabled as a gateway in Netlify) are not shown on login page.
Expected behavior Each website in a repo has it's own CMS such that content from other websites is not shown. Stretch goal would be prefixing commit messages with the site that the git change refers to.
Screenshots
Ah, Gatsby - does each Gatsby site have it's own separate build or is the build somehow combined? Can you provide a repo that minimally reproduces this issue?
Each site has it's own build. The repo essentially has a directory sites/
that inside has a directory for each domain and each of those site domain directories is a complete Gatsby site and build.
Example: https://github.com/adrw/westegg/tree/2713280ea07db75a3bd3aba9e86fc968d720cffa/sites
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@adrw have you been able to find a solution to this?
I've been trying to see how to configure the git-gateway "base dir" to my site
So basically, git-gateway with netlify-cms doesn't support the case where the netlify site is not installed at the root?
if is possible to do this?
have the netlify site at /folder instead of root?
@erquhart
Well I got this working by putting the correct path to the different entries in config.yml, e.g.:
media_folder: packages/site-1/static/img
Now what is awkward with git-gateway is that permissions are given for the whole repository.
So in a monorepo setup, the git-gateway for one site will allow access to the whole repository, I've opened an issue here: https://github.com/netlify/git-gateway/issues/38
Ideally you would be able to tell git-gateway to only allow access to specific paths, something like:
# config.yml for site 1
backend:
name: git-gateway
accept_roles:
- admin
- editor
accept_content_routes: # <------ restrict content access to those paths only
- packages/site1
# config.yml for site 2
backend:
name: git-gateway
accept_roles:
- admin
- editor
accept_content_routes: # <------ restrict content access to those paths only
- packages/site2
any thoughts @erquhart
I'm not sure if I understand this, it still open. So Netlify CMS can't build from a folder yet?
I just wanted to structure a web monorepo that have a static site, cms, components, small backend. The cms is only one.
U guys can use npm workspace
with multiples monorepos for multiple websites.