Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 03683f0

Browse files
committed
adding logic to manage gh pages vs cloudflare deployments
1 parent a8ab31d commit 03683f0

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

docs/astro.config.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ import starlightVideos from 'starlight-videos'
77

88
// https://astro.build/config
99
export default defineConfig({
10-
site: 'https://cortex.so',
10+
site: process.env.GITHUB_ACTIONS
11+
? 'https://menloresearch.github.io/cortex.cpp'
12+
: 'https://cortex.so',
13+
base: process.env.GITHUB_ACTIONS ? '/cortex.cpp' : '',
1114
integrations: [
1215
starlight({
1316
title: "Cortex",

docs/src/components/Navigation.astro

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ export interface Props {
44
}
55
66
const { activeTab = "home" } = Astro.props;
7+
const basePath = import.meta.env.BASE_URL || '';
78
---
89

910
<nav class="floating-nav">
10-
<a href="/" class={activeTab === "home" ? "active" : ""}>Home</a>
11-
<a href="/overview" class={activeTab === "docs" ? "active" : ""}>Docs</a>
12-
<a href="/model-hub" class={activeTab === "model-hub" ? "active" : ""}>Model Hub</a>
13-
<!-- <a href="/blog" class={activeTab === "blog" ? "active" : ""}>Blog</a> -->
11+
<a href={`${basePath}/`} class={activeTab === "home" ? "active" : ""}>Home</a>
12+
<a href={`${basePath}/overview`} class={activeTab === "docs" ? "active" : ""}>Docs</a>
13+
<a href={`${basePath}/model-hub`} class={activeTab === "model-hub" ? "active" : ""}>Model Hub</a>
14+
<!-- <a href={`${basePath}/blog`} class={activeTab === "blog" ? "active" : ""}>Blog</a> -->
1415
<button class="mobile-menu-toggle" aria-label="Toggle menu">
1516
<span></span>
1617
<span></span>

0 commit comments

Comments
 (0)