-
-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This makes the content more immediately accessible and easier to browse through. Styling has also been adjusted as necessary to accomodate a flatter hierarchy of items; presenting content as a list with headers instead of a grid of cards.
- Loading branch information
Showing
9 changed files
with
142 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React from "react"; | ||
import clsx from "clsx"; | ||
import { useCurrentSidebarCategory, filterDocCardListItems } from "@docusaurus/theme-common"; | ||
import DocCard from "@theme/DocCard"; | ||
import type { Props } from "@theme/DocCardList"; | ||
|
||
function DocCardListForCurrentSidebarCategory({ className }: Props) { | ||
const category = useCurrentSidebarCategory(); | ||
return <DocCardList items={category.items} className={className} />; | ||
} | ||
|
||
export default function DocCardList(props: Props): JSX.Element { | ||
const { items, className } = props; | ||
if (!items) { | ||
return <DocCardListForCurrentSidebarCategory {...props} />; | ||
} | ||
const filteredItems = filterDocCardListItems(items); | ||
return ( | ||
<section> | ||
{filteredItems.map((item, index) => ( | ||
<article key={index} className="margin-bottom--lg"> | ||
<DocCard item={item} /> | ||
</article> | ||
))} | ||
</section> | ||
); | ||
} |