mirror of
https://github.com/tale/headplane.git
synced 2026-07-26 07:48:14 +00:00
docs: deploy stable and beta docs
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
import { defineConfig } from "vitepress";
|
||||
|
||||
export default defineConfig({
|
||||
vite: {
|
||||
define: {
|
||||
__HEADPLANE_BETA_DOCS__: JSON.stringify(process.env.HEADPLANE_BETA_DOCS === "true"),
|
||||
},
|
||||
},
|
||||
title: "Headplane",
|
||||
description: "The missing dashboard for Headscale",
|
||||
cleanUrls: true,
|
||||
|
||||
@@ -1,17 +1,42 @@
|
||||
html.dark .light-only {
|
||||
display: none !important;
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
html:not(.dark) .dark-only {
|
||||
display: none !important;
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
figure {
|
||||
padding: 1em;
|
||||
padding: 1em;
|
||||
}
|
||||
|
||||
figcaption {
|
||||
text-align: center;
|
||||
font-size: 0.9em;
|
||||
margin-top: 0.5em;
|
||||
text-align: center;
|
||||
font-size: 0.9em;
|
||||
margin-top: 0.5em;
|
||||
}
|
||||
|
||||
:root {
|
||||
--vp-layout-top-height: 36px;
|
||||
}
|
||||
|
||||
.beta-banner {
|
||||
background-color: var(--vp-c-bg);
|
||||
background-image: linear-gradient(var(--vp-c-warning-soft), var(--vp-c-warning-soft));
|
||||
color: var(--vp-c-warning-1);
|
||||
text-align: center;
|
||||
padding: 8px 16px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.beta-banner a {
|
||||
color: var(--vp-c-warning-1);
|
||||
text-decoration: underline;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
/// <reference types="vitepress/client" />
|
||||
|
||||
declare const __HEADPLANE_BETA_DOCS__: boolean;
|
||||
@@ -1,4 +1,36 @@
|
||||
import DefaultTheme from 'vitepress/theme';
|
||||
import './custom.css';
|
||||
import type { Theme } from "vitepress";
|
||||
import DefaultTheme from "vitepress/theme";
|
||||
import { h } from "vue";
|
||||
|
||||
export default DefaultTheme;
|
||||
import "./custom.css";
|
||||
|
||||
const beta = __HEADPLANE_BETA_DOCS__ ?? false;
|
||||
|
||||
export default {
|
||||
extends: DefaultTheme,
|
||||
Layout() {
|
||||
return h(DefaultTheme.Layout, null, {
|
||||
"layout-top": () =>
|
||||
beta
|
||||
? h(
|
||||
"div",
|
||||
{
|
||||
class: "beta-banner",
|
||||
},
|
||||
[
|
||||
"You are currently viewing the ",
|
||||
h("strong", "beta"),
|
||||
" documentation for Headplane. ",
|
||||
h(
|
||||
"a",
|
||||
{
|
||||
href: "https://headplane.net",
|
||||
},
|
||||
"Go to the stable docs →",
|
||||
),
|
||||
],
|
||||
)
|
||||
: null,
|
||||
});
|
||||
},
|
||||
} satisfies Theme;
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"include": [".vitepress/**/*"],
|
||||
"compilerOptions": {
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"target": "ES2022",
|
||||
"lib": ["DOM", "DOM.Iterable", "ES2023"],
|
||||
"noEmit": true,
|
||||
"strict": true,
|
||||
"skipLibCheck": true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user