Files
continuwuity/theme/index.tsx
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
1.7 KiB
TypeScript
Raw Normal View History

2026-01-29 10:35:19 -05:00
import { HomeLayout as BasicHomeLayout, DocContent } from "@rspress/core/theme-original";
2025-11-22 20:58:18 +00:00
2025-11-22 22:41:53 +00:00
import { useFrontmatter } from '@rspress/core/runtime';
interface HomeLayoutProps {
components?: Record<string, React.FC>;
}
2025-11-22 20:58:18 +00:00
2025-11-22 22:41:53 +00:00
function HomeLayout(props: HomeLayoutProps) {
console.log(props)
const { frontmatter } = useFrontmatter();
return (
<BasicHomeLayout
2026-02-11 18:25:11 +00:00
beforeFeatures={
frontmatter.beforeFeatures ? (
<section className="custom-section">
<div className="rp-container">
<div className="custom-cards">
{frontmatter.beforeFeatures.map((item: any, index: number) => (
<a key={index} href={item.link} className="custom-card" target="_blank" rel="noopener noreferrer">
<h3>{item.title}</h3>
<p>{item.details}</p>
<span className="custom-card-button">{item.buttonText || 'Learn More'} </span>
</a>
))}
</div>
</div>
</section>
) : <></>
}
2025-11-22 22:41:53 +00:00
afterFeatures={
(frontmatter.doc) ?
<main className="rp-doc-layout__doc-container">
<div className="rp-doc rspress-doc">
<DocContent components={props.components} />
</div>
</main>
: <></>
}
/>
);
}
export { HomeLayout };
2026-01-29 10:35:19 -05:00
export * from "@rspress/core/theme-original";
2025-11-22 22:41:53 +00:00
import "./index.css";