forked from monero-project/monero-site
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPreviewBanner.astro
More file actions
35 lines (32 loc) · 935 Bytes
/
Copy pathPreviewBanner.astro
File metadata and controls
35 lines (32 loc) · 935 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
---
const isCoolifyPreview = import.meta.env.COOLIFY_PREVIEW;
const sourceCommit = import.meta.env.SOURCE_COMMIT;
const coolifyBranch = import.meta.env.COOLIFY_BRANCH; // "pull/2639/head:pr-2639-coolify",
const coolifyRepo = import.meta.env.COOLIFY_REPO;
if (!isCoolifyPreview) return;
const coolifyPrNum = coolifyBranch.split("/")[1];
---
<div class="preview-banner">
<span class="preview-banner-style">
<a href={`${coolifyRepo}/pull/${coolifyPrNum}/changes/${sourceCommit}`}
>{sourceCommit.slice(0, 7)}</a
> Preview powered by <a href="https://coolify.io/">Coolify</a>
</span>
</div>
<style>
.preview-banner {
position: fixed;
bottom: 0;
left: 0;
right: 0;
text-align: center;
z-index: 999;
}
.preview-banner-style {
display: inline-block;
background: black;
color: white;
padding: var(--space-2xs) var(--space-md);
border-radius: var(--radius-md);
}
</style>