This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
dagger/docs/faq/index.md
guillaume 49de5d022c docs: docs: guide - default values cue
Add default values cue doc page + implement all maintainers suggestions

Signed-off-by: guillaume <guillaume.derouville@gmail.com>
2022-04-14 16:13:15 +02:00

1019 B

slug displayed_sidebar
/faq 0.2

FAQ

import DocCardList from '@theme/DocCardList';
import {useDocsVersion} from '@docusaurus/theme-common';

export const FaqItems = () => {
    {/* access root category object from Docusaurus */}
    const docsVersion = useDocsVersion();
    {/* customProps object retrieved from sidebar.js */}
    const faqItem = docsVersion.docsSidebars['0.2'].filter(item => item.label === 'FAQ');
    {/* Return custom FAQ Items array */}
    const customPropsItem = faqItem[0].customProps.items.map(customPropsItem => {
        const result = Object.values(docsVersion.docs).filter(item => item.id === customPropsItem.docId)[0]
        if(result)
            return {
                type: "link",
                label: result.title,
                description: result.description,
                href: customPropsItem.href,
                docId: customPropsItem.docId
            }
    })
    return <DocCardList items={customPropsItem}/>
}

<FaqItems />