mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-12-05 14:51:45 +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);
|
--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-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: rgba(0, 0, 0, 0.2);
|
||||||
--rp-c-divider-light: rgba(0, 0, 0, 0.1);
|
--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 { Banner, HomeLayout as BasicHomeLayout, Layout as BasicLayout, DocContent } from "@rspress/core/theme-original";
|
||||||
|
import { useFrontmatter, useSite } from '@rspress/core/runtime';
|
||||||
import { useFrontmatter } from '@rspress/core/runtime';
|
|
||||||
interface HomeLayoutProps {
|
interface HomeLayoutProps {
|
||||||
components?: Record<string, React.FC>;
|
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) {
|
function HomeLayout(props: HomeLayoutProps) {
|
||||||
console.log(props)
|
console.log(props)
|
||||||
|
|
||||||
@@ -41,6 +59,6 @@ function HomeLayout(props: HomeLayoutProps) {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
export { HomeLayout };
|
export { HomeLayout, Layout };
|
||||||
export * from "@rspress/core/theme-original";
|
export * from "@rspress/core/theme-original";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
Reference in new issue
Block a user