mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-28 19:37:32 +00:00
docs(preview): Add banner for preview deployments
This commit is contained in:
1 parent
67332244b7
commit
b85a4ce194
2 files changed
+23
-4
No files matched your search
@@ -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);
|
||||
|
||||
+22
-4
@@ -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<string, React.FC>;
|
||||
}
|
||||
|
||||
const Layout = () => {
|
||||
const { site } = useSite();
|
||||
const sitePath: string = site.base;
|
||||
const prNumber: string = sitePath.substring(sitePath.indexOf("@") + 1, sitePath.lastIndexOf("/"));
|
||||
|
||||
return (
|
||||
<BasicLayout
|
||||
beforeNav={
|
||||
sitePath != "/" ? (
|
||||
<Banner
|
||||
href={`https://forgejo.ellis.link/continuwuation/continuwuity/pulls/${prNumber}`}
|
||||
message={`Documentation preview for PR #${prNumber}`}
|
||||
/>
|
||||
) : 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";
|
||||
Reference in new issue
Block a user