Open chrisjansky opened 2 months ago
Hello,
I am wondering if I can somehow access a dynamic index/context/etc when inside a Markdown Component.
index
context
I am building an according FAQ section using radix-vue Accordion which I would like to populate with MDC like so:
radix-vue
::question How do I pay? #answer You pay like this. :: ::question How is VAT collected? #answer VAT is collected like this. ::
The problem is, radix-vue <Accordion> needs a dynamic value to key the items and set the default opened <AccordionItem>.
radix-vue <Accordion>
value
<AccordionItem>
Something simple like ::question{:index=$doc.index} would therefore work just fine. Has someone implemented a similar feature?
::question{:index=$doc.index}
Thanks for any pointers.
You can define a variable in front matter and use it in component props:
--- index --- ::question{:index="index"} How do I pay? #answer You pay like this. ::
Hello,
I am wondering if I can somehow access a dynamic
index
/context
/etc when inside a Markdown Component.I am building an according FAQ section using
radix-vue
Accordion which I would like to populate with MDC like so:The problem is,
radix-vue <Accordion>
needs a dynamicvalue
to key the items and set the default opened<AccordionItem>
.Something simple like
::question{:index=$doc.index}
would therefore work just fine. Has someone implemented a similar feature?Thanks for any pointers.