content
content copied to clipboard
Allow ContentDoc's path to be an array
Is your feature request related to a problem? Please describe
If one wants to mimic the "document-driven" functionality and map certain routes automatically to the corresponding content folder, one ends up with something like
<template>
<main>
<ContentDoc
:path="markdownPath"
/>
</main>
</template>
<script setup lang="ts">
let markdownPath = ''
if (typeof route.params.slug === 'string') {
markdownPath += route.params.slug
} else {
markdownPath += route.params.slug
.map((param) => param.toLowerCase())
.join('/')
}
</script>
Describe the solution you'd like
It would be nice if ContentDoc's path prop could admit an array, so that one could simply pass route.params.slug into it.
Describe alternatives you've considered
The above code is a working alternative, but it becomes somewhat repetitive to do this for multiple pages.
Additional context
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.
Still relevant.