Skip to content

Commit 8ac0194

Browse files
committed
fix: move all dynamic config to nuxt.config.ts for proper env var handling
- Move versioning, docus URLs, github branch to nuxt.config appConfig - Remove process.env usage from app.config.ts (doesn't work at build time) - Replace DocsVersionBanner with AppHeader that includes banner - This ensures DOCS_VERSION env var is properly read during build
1 parent c5be80b commit 8ac0194

File tree

4 files changed

+43
-36
lines changed

4 files changed

+43
-36
lines changed

docs/app.config.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,23 @@
1-
const baseURL = process.env.NUXT_APP_BASE_URL || '/'
2-
const currentVersion = process.env.DOCS_VERSION || 'v3'
3-
41
export default defineAppConfig({
52
docus: {
63
title: 'Flowforge',
74
description: 'Transform any Laravel model into production-ready drag-and-drop Kanban boards.',
8-
url: `https://relaticle.github.io${baseURL}`,
9-
image: `${baseURL}preview.png`,
105
header: {
116
logo: {
127
alt: 'Flowforge Logo',
13-
light: `${baseURL}logo-light.svg`,
14-
dark: `${baseURL}logo-dark.svg`
158
}
169
}
1710
},
1811
seo: {
1912
title: 'Flowforge',
2013
description: 'Transform any Laravel model into production-ready drag-and-drop Kanban boards.',
21-
ogImage: `${baseURL}preview.png`
2214
},
2315
github: {
24-
branch: currentVersion === 'v3' ? '3.x' : '2.x',
2516
repo: 'flowforge',
2617
owner: 'Relaticle',
2718
edit: true,
2819
rootDir: 'docs'
2920
},
30-
versioning: {
31-
current: currentVersion,
32-
versions: [
33-
{ label: 'v3 (Latest)', value: 'v3', path: '/flowforge/' },
34-
{ label: 'v2', value: 'v2', path: '/flowforge/v2/' }
35-
]
36-
},
3721
socials: {
3822
discord: 'https://discord.gg/b9WxzUce4Q'
3923
},

docs/components/AppHeader.vue

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<script setup lang="ts">
2+
const appConfig = useAppConfig()
3+
const currentVersion = appConfig.versioning?.current || 'v3'
4+
const isOldVersion = currentVersion !== 'v3'
5+
</script>
6+
7+
<template>
8+
<div>
9+
<div
10+
v-if="isOldVersion"
11+
class="bg-amber-100 dark:bg-amber-900/50 text-amber-800 dark:text-amber-200 px-4 py-2 text-center text-sm border-b border-amber-200 dark:border-amber-800"
12+
>
13+
You are viewing documentation for Flowforge {{ currentVersion }}.
14+
<a
15+
href="/flowforge/"
16+
class="underline font-medium hover:text-amber-900 dark:hover:text-amber-100"
17+
>
18+
View the latest version (v3) &rarr;
19+
</a>
20+
</div>
21+
<DocsHeader />
22+
</div>
23+
</template>

docs/components/DocsVersionBanner.vue

Lines changed: 0 additions & 20 deletions
This file was deleted.

docs/nuxt.config.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,28 @@ export default defineNuxtConfig({
1010
name: 'Flowforge',
1111
},
1212
appConfig: {
13+
docus: {
14+
url: `https://relaticle.github.io${baseURL}`,
15+
image: `${baseURL}preview.png`,
16+
header: {
17+
logo: {
18+
light: `${baseURL}logo-light.svg`,
19+
dark: `${baseURL}logo-dark.svg`,
20+
},
21+
},
22+
},
23+
seo: {
24+
ogImage: `${baseURL}preview.png`,
25+
},
26+
github: {
27+
branch: docsVersion === 'v3' ? '3.x' : '2.x',
28+
},
1329
versioning: {
1430
current: docsVersion,
31+
versions: [
32+
{ label: 'v3 (Latest)', value: 'v3', path: '/flowforge/' },
33+
{ label: 'v2', value: 'v2', path: '/flowforge/v2/' },
34+
],
1535
},
1636
},
1737
app: {

0 commit comments

Comments
 (0)