Skip to content

Commit d3e0cb1

Browse files
authored
Added enable parameter for rendering index page (#289)
1 parent 8a8db5c commit d3e0cb1

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "codex.docs",
33
"license": "Apache-2.0",
4-
"version": "v2.0.0-rc.4",
4+
"version": "v2.2.0-rc.1",
55
"type": "module",
66
"bin": {
77
"codex.docs": "dist/backend/app.js"

src/backend/build-static.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ export default async function buildStatic(): Promise<void> {
111111
await renderPage(page);
112112
}
113113

114-
await renderIndexPage(config.indexPageUri);
114+
// Check if index page is enabled
115+
if (config.indexPage.enabled) {
116+
await renderIndexPage(config.indexPage.uri);
117+
}
115118
console.log('Static files built');
116119

117120
console.log('Copy public directory');

src/backend/utils/appConfig.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ const FrontendConfig = z.object({
9090
*/
9191
const StaticBuildConfig = z.object({
9292
outputDir: z.string(), // Output directory for static build
93-
indexPageUri: z.string(), // URI for index page to render
93+
indexPage: z.object({
94+
enabled: z.boolean(), // Is index page enabled
95+
uri: z.string(), // Index page uri
96+
}),
9497
});
9598

9699
export type StaticBuildConfig = z.infer<typeof StaticBuildConfig>;

0 commit comments

Comments
 (0)