Skip to content

Commit 340f4f8

Browse files
committed
Make versioned docs config standalone without imports
1 parent 66552ae commit 340f4f8

File tree

1 file changed

+16
-28
lines changed

1 file changed

+16
-28
lines changed

.github/workflows/docs.yml

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -137,30 +137,8 @@ jobs:
137137
localIconLoader,
138138
} from "vitepress-plugin-group-icons"
139139
140-
// Read the original config dynamically
141-
import originalConfig from './config.mts'
142-
143140
const BASE = '/v${{ matrix.version }}/'
144141
145-
// Helper to prefix links with base path
146-
function prefixLink(link: string): string {
147-
if (!link || link.startsWith('http') || link.startsWith('#')) return link
148-
return BASE.slice(0, -1) + link
149-
}
150-
151-
// Recursively prefix links in nav/sidebar items
152-
function prefixItems(items: any[]): any[] {
153-
if (!items) return items
154-
return items.map(item => ({
155-
...item,
156-
link: item.link ? prefixLink(item.link) : undefined,
157-
items: item.items ? prefixItems(item.items) : undefined
158-
}))
159-
}
160-
161-
// Get the original theme config
162-
const origTheme = originalConfig.themeConfig || {}
163-
164142
export default defineConfig({
165143
base: BASE,
166144
ignoreDeadLinks: true,
@@ -205,12 +183,22 @@ jobs:
205183
search: {
206184
provider: 'local',
207185
},
208-
editLink: origTheme.editLink,
209-
nav: prefixItems(origTheme.nav || []),
210-
sidebar: Array.isArray(origTheme.sidebar)
211-
? prefixItems(origTheme.sidebar)
212-
: origTheme.sidebar,
213-
socialLinks: origTheme.socialLinks || [],
186+
editLink: {
187+
pattern: 'https://github.com/activeagents/activeagent/edit/main/docs/:path',
188+
text: 'Suggest changes to this page on GitHub'
189+
},
190+
nav: [
191+
{ text: 'Home', link: '/' },
192+
{ text: 'Docs', link: '/docs' },
193+
{ text: 'GitHub', link: 'https://github.com/activeagents/activeagent' }
194+
],
195+
sidebar: [
196+
{ text: 'Overview', link: '/docs' },
197+
{ text: 'Getting Started', link: '/docs/getting-started' },
198+
],
199+
socialLinks: [
200+
{ icon: 'github', link: 'https://github.com/activeagents/activeagent' }
201+
],
214202
},
215203
})
216204
EOFCONFIG

0 commit comments

Comments
 (0)