content
content copied to clipboard
Base public path option
Is your feature request related to a problem? Please describe
Sometimes we want to deliver the public path of nuxt/content in a sub directory(e.g. /v8) instead of the root /.
In the nuxtjs/i18n use case, I want to run the v7 and v8 alpha versions of the documentation on the same domain, but on separate git branches.
ref: https://github.com/nuxt-community/i18n-module/discussions/1287#discussioncomment-3493467
Describe the solution you'd like
We hope configration like vite base option.
https://vitejs.dev/config/shared-options.html#base
Describe alternatives you've considered
sources configration
https://content.nuxtjs.org/api/configuration#sources
Additional context
WDYT @farnabaz ?
I like the idea of having a base, especially in documentDriven mode which the catch-all page can register under this base path and the rest URLs will be handled normally by Nuxt pages.
however, without the need for any changes, this can be done using sources by adding prefix to the content source
export default defineNuxtConfig({
content: {
sources: [
{
name: 'content',
prefix: '/v8',
driver: 'fs',
base: resolve(__dirname, 'content')
}
]
}
})