-
Newbie here :) Trying to use Nuxt Image in markdown syntax to provide a figcaption for image, but with no luck. I don't know the issue should be about Nuxt Image, Docus, or Nuxt Content? My minimum not-working example: https://github.com/dofine/docus-test-image and the deploy: https://docus-test-image.vercel.app/ Some search results: nuxt/content#1537 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @dofine, It seems there is not solution for now. See related issue: nuxt/content#390 |
Beta Was this translation helpful? Give feedback.
-
There is no built-in way, but a workaround is easy. Nuxt Content uses MDC, which provides an easy way to modify any HTML component created from Markdown. Create a file called <template>
<figure v-if="caption">
<component
:is="imgComponent"
:src="refinedSrc"
:alt="alt"
:width="width"
:height="height"
/>
<figcaption v-html="caption" />
</figure>
<component
v-else
:is="imgComponent"
:src="refinedSrc"
:alt="alt"
:width="width"
:height="height"
/>
</template> |
Beta Was this translation helpful? Give feedback.
Hi @dofine,
It seems there is not solution for now. See related issue: nuxt/content#390