1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-07-19 21:29:41 +02:00

[Feature] Static pages rendering 🤩 (#274)

This commit is contained in:
Nikita Melnikov 2022-10-17 08:25:38 +08:00 committed by GitHub
parent 8c794304b6
commit 4ad37abed0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 554 additions and 705 deletions

View file

@ -84,6 +84,16 @@ const FrontendConfig = z.object({
uri: z.string() })])), // Menu for pages
});
/**
* Static build configuration
*/
const StaticBuildConfig = z.object({
outputDir: z.string(), // Output directory for static build
indexPageUri: z.string(), // URI for index page to render
});
export type StaticBuildConfig = z.infer<typeof StaticBuildConfig>;
/**
* Application configuration
*/
@ -97,6 +107,7 @@ const AppConfig = z.object({
frontend: FrontendConfig, // Frontend configuration
auth: AuthConfig, // Auth configuration
database: z.union([LocalDatabaseConfig, MongoDatabaseConfig]), // Database configuration
staticBuild: StaticBuildConfig.optional(), // Static build configuration
});
export type AppConfig = z.infer<typeof AppConfig>;
@ -107,7 +118,7 @@ const args = arg({ /* eslint-disable @typescript-eslint/naming-convention */
});
const cwd = process.cwd();
const paths = (args['--config'] || [ './app-config.yaml' ]).map((configPath) => {
const paths = (args['--config'] || [ './docs-config.yaml' ]).map((configPath) => {
if (path.isAbsolute(configPath)) {
return configPath;
}