content icon indicating copy to clipboard operation
content copied to clipboard

Allow ContentDoc's path to be an array

Open tobiasdiez opened this issue 3 years ago • 2 comments

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

tobiasdiez avatar Sep 13 '22 17:09 tobiasdiez

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.

github-actions[bot] avatar Feb 07 '25 12:02 github-actions[bot]

Still relevant.

tobiasdiez avatar Feb 07 '25 12:02 tobiasdiez