Skip to content

Commit 841d135

Browse files
committed
添加第三方构建提示
1 parent 02e5a3e commit 841d135

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

astro.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export default defineConfig({
6868
en: "HMCL Documentation",
6969
},
7070
components: {
71+
Banner: "./src/components/starlight/Banner.astro",
7172
PageTitle: "./src/components/starlight/PageTitle.astro",
7273
Footer: "./src/components/starlight/Footer.astro",
7374
},
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
3+
---
4+
5+
<div class="unofficial-site-alert">
6+
您正在访问第三方构建的文档站。如需查看官方文档,请<a href="https://docs.hmcl.net">点击此处</a
7+
>跳转。
8+
</div>
9+
10+
<style>
11+
.unofficial-site-alert {
12+
text-align: center;
13+
padding: 0.75em 1em;
14+
background-color: var(--sl-color-orange-low);
15+
}
16+
</style>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
import DefaultBanner from "@astrojs/starlight/components/Banner.astro";
3+
import UnofficialSiteAlert from "@components/UnofficialSiteAlert.astro";
4+
5+
const displayUnofficialSiteAlert = import.meta.env.PUBLIC_SITE_URL !== "https://docs.hmcl.net";
6+
---
7+
8+
{displayUnofficialSiteAlert && <UnofficialSiteAlert />}
9+
10+
<DefaultBanner />

0 commit comments

Comments
 (0)