Mismatch between repo path and collection folder when deploying from a monorepo
I think I'm looking for some concept like a "root dir".
In my setup, I have a nuxt app which serves decap and render's its content. The thing is, the app is in a subdirectory in my repository and the entire thing is a monorepo. It looks something like
/
└── nuxt-app/
└── content/
├── blog
├── handbook
└── pages
In my config, I have these collections to match
backend:
name: github
collections:
- name: handbook
label: "Handbook articles"
label_singular: Handbook article
identifier_field: id
folder: "content/handbook"
extension: md
widget: "list"
create: true
i18n: true
summary: "{{title}}"
view_groups:
- label: Section
field: section
path: '{{section}}/{{slug}}'
fields: []
- name: pages
label: "Pages"
folder: "content/pages"
extension: md
widget: "list"
create: false
i18n: true
fields: []
- name: blog
label: Blog
label_singular: Blog Post
folder: "content/blog"
extension: md
widget: "list"
create: true
i18n: true
fields: []
See that each collection's folder is content/*, which works when I add local_backend: true. But when I run the deployed app, I assume decap is looking for content/blog, etc in the root of the repository.
I see a number of possible solutions but none that exist
-
Add an option to
local_backendlocal_backend: root: nuxt-app collections: - name: blog: folder: nuxt-app/content/blogThis way, the
foldermust match the repo butlocal_backendremoves it when serving local. Not super fond of this, as it appear a little unintuitive -
Add an option to
githubbackendbackend: name: github rootDir: nuxt-app collections: - name: blog: folder: content/blogA little better, keeps the relative path for
folderoptions but the additionalrootDirproperty of GH backend tells it look for content in the right subdirectory.
My current workaround is to set the full repo paths in folder of each collection and run local decap server like cd ../..; decap-server