diff --git a/.changeset/sharp-suits-behave.md b/.changeset/sharp-suits-behave.md new file mode 100644 index 000000000..178d8e071 --- /dev/null +++ b/.changeset/sharp-suits-behave.md @@ -0,0 +1,5 @@ +--- +"@suid/site": patch +--- + +Keep component names diff --git a/packages/site/src/components/ComponentInfo.tsx b/packages/site/src/components/ComponentInfo.tsx index 40c149990..52203c40f 100644 --- a/packages/site/src/components/ComponentInfo.tsx +++ b/packages/site/src/components/ComponentInfo.tsx @@ -11,12 +11,13 @@ import { Match, Show, Switch, + mergeProps, } from "solid-js"; import ComponentCode from "~/components/ComponentCode"; import PageNav from "~/components/PageNav"; import PaperCode from "~/components/PaperCode"; -export default function ComponentInfo(props: { +export default function ComponentInfo(inProps: { name: string; scope?: string; body?: JSXElement; @@ -34,6 +35,11 @@ export default function ComponentInfo(props: { prevPage?: { text: string; href: string }; nextPage?: { text: string; href: string }; }) { + const props = mergeProps(inProps, { + get name() { + return inProps.name.replace(/\d+$/, ""); + }, + }); const name = createMemo(() => snakeCase(uncapitalize(props.name))); const theme = useTheme(); const docsName = () => props.docsName ?? name();