diff --git a/apps/docs/.env.example b/apps/docs/.env.example new file mode 100644 index 00000000..d5de49be --- /dev/null +++ b/apps/docs/.env.example @@ -0,0 +1 @@ +NEXT_PUBLIC_OPENPANEL_CLIENT_ID= \ No newline at end of file diff --git a/apps/docs/astro.config.mjs b/apps/docs/astro.config.mjs index a27eb759..37c8936f 100644 --- a/apps/docs/astro.config.mjs +++ b/apps/docs/astro.config.mjs @@ -1,7 +1,7 @@ import sitemap from "@astrojs/sitemap"; import starlight from "@astrojs/starlight"; import tailwind from "@astrojs/tailwind"; -import { defineConfig } from "astro/config"; +import { defineConfig, envField } from "astro/config"; import starlightSidebarTopics from "starlight-sidebar-topics"; import Icons from "unplugin-icons/vite"; @@ -11,6 +11,14 @@ export default defineConfig({ vite: { plugins: [Icons({ compiler: "astro" })], }, + env: { + schema: { + NEXT_PUBLIC_OPENPANEL_CLIENT_ID: envField.string({ + access: "public", + context: "client", + }), + }, + }, integrations: [ sitemap(), starlight({ diff --git a/apps/docs/package.json b/apps/docs/package.json index 9f809e3a..99986023 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -16,6 +16,7 @@ "@astrojs/starlight": "0.32.6", "@astrojs/starlight-tailwind": "3.0.1", "@astrojs/tailwind": "6.0.0", + "@openpanel/astro": "1.0.1", "astro": "5.6.1", "sharp": "0.33.5", "starlight-showcases": "0.3.0", diff --git a/apps/docs/src/components/Head.astro b/apps/docs/src/components/Head.astro index 819637f4..f4e97b78 100644 --- a/apps/docs/src/components/Head.astro +++ b/apps/docs/src/components/Head.astro @@ -1,6 +1,7 @@ --- +import { NEXT_PUBLIC_OPENPANEL_CLIENT_ID } from "astro:env/client"; import Default from "@astrojs/starlight/components/Head.astro"; - +import { OpenPanelComponent } from "@openpanel/astro"; const title = Astro.locals.starlightRoute.title; const { siteTitle } = Astro.locals.starlightRoute; @@ -17,3 +18,5 @@ const url = `https://openstatus.dev/api/og?title=${siteTitle}&description=${titl