diff --git a/theme/index.css b/theme/index.css index 4b76493bc..bc59deb9d 100644 --- a/theme/index.css +++ b/theme/index.css @@ -29,6 +29,7 @@ --card-bg: oklch(from var(--panel-bg) var(--background-lightness) c h); --rp-home-background-bg: radial-gradient(42.12% 56.13% at 100% 0%, oklch(from var(--c2) var(--background-lightness) c h) 0%, #fff0 100%), radial-gradient(42.01% 79.63% at 52.86% 0%, #d9ff5333 0%, #fff0 100%), radial-gradient(79.67% 58.09% at 0% 0%, oklch(from var(--c1) var(--background-lightness) c h) 0%, #fff0 100%), var(--rp-c-bg); + --rp-banner-background: linear-gradient(279deg, var(--rp-c-brand-dark) 35.21%, var(--rp-c-brand-light) 63.34%); --rp-c-divider: rgba(0, 0, 0, 0.2); --rp-c-divider-light: rgba(0, 0, 0, 0.1); diff --git a/theme/index.tsx b/theme/index.tsx index 2c9250c50..ab635e1ef 100644 --- a/theme/index.tsx +++ b/theme/index.tsx @@ -1,10 +1,28 @@ -import { HomeLayout as BasicHomeLayout, DocContent } from "@rspress/core/theme-original"; - -import { useFrontmatter } from '@rspress/core/runtime'; +import { Banner, HomeLayout as BasicHomeLayout, Layout as BasicLayout, DocContent } from "@rspress/core/theme-original"; +import { useFrontmatter, useSite } from '@rspress/core/runtime'; interface HomeLayoutProps { components?: Record; } +const Layout = () => { + const { site } = useSite(); + const sitePath: string = site.base; + const prNumber: string = sitePath.substring(sitePath.indexOf("@") + 1, sitePath.lastIndexOf("/")); + + return ( + + ) : null + } + /> + ); +}; + function HomeLayout(props: HomeLayoutProps) { console.log(props) @@ -41,6 +59,6 @@ function HomeLayout(props: HomeLayoutProps) { /> ); } -export { HomeLayout }; +export { HomeLayout, Layout }; export * from "@rspress/core/theme-original"; import "./index.css";