diff --git a/src/app.d.ts b/src/app.d.ts index a8265e1..5be589b 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -14,6 +14,7 @@ declare global { // Make version available globally const __APP_VERSION__: string; + const __DEPLOY_ENV__: string; } // SVG imports diff --git a/src/lib/components/home/HomepageCategories.svelte b/src/lib/components/home/HomepageCategories.svelte index 024040a..46f638e 100644 --- a/src/lib/components/home/HomepageCategories.svelte +++ b/src/lib/components/home/HomepageCategories.svelte @@ -9,6 +9,7 @@ import { extractNavItems } from '$lib/utils/nav'; import QuickTips from '$lib/components/furniture/QuickTips.svelte'; import KeyboardShortcutChip from '$lib/components/common/KeyboardShortcutChip.svelte'; + import { isStaticDeployment } from '$lib/utils/deployment'; import { onMount, onDestroy } from 'svelte'; import { browser } from '$app/environment'; @@ -41,7 +42,9 @@ } // Memoized categories - computed once at module scope (static data) - const categories: CategorySection[] = TOP_NAV.filter((nav) => nav.href !== '/reference') + const categories: CategorySection[] = TOP_NAV.filter( + (nav) => nav.href !== '/reference' && !(isStaticDeployment && nav.href === '/diagnostics'), + ) .map((nav) => { const subItems = SUB_NAV[nav.href] || []; return { diff --git a/src/lib/utils/deployment.ts b/src/lib/utils/deployment.ts new file mode 100644 index 0000000..e498dac --- /dev/null +++ b/src/lib/utils/deployment.ts @@ -0,0 +1,14 @@ +/** + * Deployment environment utilities + */ + +/** + * Check if the app is deployed to a static host (without API support) + */ +export const isStaticDeployment = __DEPLOY_ENV__ === 'static'; + +/** + * Check if API endpoints are available + */ +// export const hasApiEndpoints = !isStaticDeployment; +export const hasApiEndpoints = !isStaticDeployment; diff --git a/src/routes/diagnostics/+layout.svelte b/src/routes/diagnostics/+layout.svelte index 59ec370..9161c0c 100644 --- a/src/routes/diagnostics/+layout.svelte +++ b/src/routes/diagnostics/+layout.svelte @@ -1,10 +1,11 @@ {#if showWarning} @@ -43,13 +36,26 @@