Skip to content

Commit fb5dbb2

Browse files
committed
update: clean up debug logging code
1 parent d33f6ff commit fb5dbb2

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/client/app/data.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,16 @@ function getExtraConfigs(path: string): SiteData[] {
9292
segments.pop()
9393
}
9494
// debug info
95-
const summaryTitle = `Extra Configs for ${path}:`
96-
const summary = configs.map((c, i) => ` ${i + 1}. ${(c as any).__module__}`)
97-
summary.push(` ${summary.length + 1}. .vitepress/config (root)`)
98-
console.info(
99-
[summaryTitle, ''.padEnd(summaryTitle.length, '='), ...summary].join('\n')
100-
)
95+
if (inBrowser) {
96+
const summaryTitle = `Config Layers for ${path}:`
97+
const summary = configs.map(
98+
(c, i) => ` ${i + 1}. ${(c as any).__module__}`
99+
)
100+
summary.push(` ${summary.length + 1}. .vitepress/config (root)`)
101+
console.debug(
102+
[summaryTitle, ''.padEnd(summaryTitle.length, '='), ...summary].join('\n')
103+
)
104+
}
101105
return configs
102106
}
103107

@@ -160,8 +164,6 @@ export function initData(route: Route): VitePressData {
160164

161165
export function useData<T = any>(): VitePressData<T> {
162166
const data = inject(dataSymbol)
163-
;(window as any).stackView = stackView
164-
;(window as any).data = data
165167
if (!data) {
166168
throw new Error('vitepress data not properly injected in app')
167169
}

0 commit comments

Comments
 (0)