-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
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_backend
local_backend: root: nuxt-app collections: - name: blog: folder: nuxt-app/content/blog
This way, the
folder
must match the repo butlocal_backend
removes it when serving local. Not super fond of this, as it appear a little unintuitive -
Add an option to
github
backendbackend: name: github rootDir: nuxt-app collections: - name: blog: folder: content/blog
A little better, keeps the relative path for
folder
options but the additionalrootDir
property of GH backend tells it look for content in the right subdirectory.