Update KEYSTATIC paths and storage handling

The code now reads storage type from a constant instead of directly from the environment variable. It also checks if `NEXT_RUNTIME` is `nodejs` before parsing Keystatic config and core reader. The `README.md` and `keystatic.config.ts` were updated to handle a new environment variable `KEYSTATIC_CONTENT_PATH` for custom content paths.
This commit is contained in:
giancarlo
2024-04-19 15:00:58 +08:00
parent 19b8cc793e
commit b58e9a3e7d
3 changed files with 20 additions and 7 deletions

View File

@@ -30,7 +30,7 @@ const storage = z.union([local, cloud, github]).parse({
pathPrefix: process.env.KEYSTATIC_PATH_PREFIX,
});
const path = process.env.KEY_STATIC_PATH ?? 'content';
const path = process.env.KEYSTATIC_CONTENT_PATH ?? 'content';
const keyStaticConfig = createKeyStaticConfig(path);