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

34 lines
1019 B
Markdown
Raw Normal View History

---
slug: /faq
displayed_sidebar: '0.2'
---
# FAQ
```mdx-code-block
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 />
```