File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ const isCoolifyPreview = import .meta .env .COOLIFY_PREVIEW ;
3+ const sourceCommit = import .meta .env .SOURCE_COMMIT ;
4+ const coolifyBranch = import .meta .env .COOLIFY_BRANCH ; // "pull/2639/head:pr-2639-coolify",
5+ const coolifyRepo = import .meta .env .COOLIFY_REPO ;
6+ if (! isCoolifyPreview ) return ;
7+ const coolifyPrNum = coolifyBranch .split (" /" )[1 ];
8+ ---
9+
10+ <div class =" preview-banner" >
11+ <span class =" preview-banner-style" >
12+ <a href ={ ` ${coolifyRepo }/pull/${coolifyPrNum }/changes/${sourceCommit } ` }
13+ >{ sourceCommit .slice (0 , 7 )} </a
14+ > Preview powered by <a href =" https://coolify.io/" >Coolify</a >
15+ </span >
16+ </div >
17+
18+ <style >
19+ .preview-banner {
20+ position: fixed;
21+ bottom: 0;
22+ left: 0;
23+ right: 0;
24+ text-align: center;
25+ z-index: 999;
26+ }
27+
28+ .preview-banner-style {
29+ display: inline-block;
30+ background: black;
31+ color: white;
32+ padding: var(--space-2xs) var(--space-md);
33+ border-radius: var(--radius-md);
34+ }
35+ </style >
Original file line number Diff line number Diff line change 11---
2+ import PreviewBanner from " @/components/ui/PreviewBanner.astro" ;
23import Footer from " @/components/ui/Footer.astro" ;
34import Header from " @/components/ui/header/Header.astro" ;
45import { locales } from " @/i18n/config" ;
@@ -130,6 +131,7 @@ const fullTitle = title.includes("|")
130131 <slot />
131132 </main >
132133 <Footer />
134+ <PreviewBanner />
133135 </body >
134136</html >
135137
You can’t perform that action at this time.
0 commit comments