diff --git a/src/schemas/config.ts b/src/schemas/config.ts index b910611..03afeeb 100644 --- a/src/schemas/config.ts +++ b/src/schemas/config.ts @@ -21,21 +21,23 @@ export const configServerSchema = processEnvSchema .omit({ SITE_URL: true, PREVIEW_MODE: true }) .extend({ PREVIEW_MODE: z.boolean() }); // here its boolean, not 'true' | 'false' -export const configClientSchema = processEnvSchema.pick({ SITE_URL: true }).merge( - z.object({ - SITE_TITLE: z.string().min(1), - SITE_DESCRIPTION: z.string().min(1), - PAGE_SIZE_POST_CARD: z.number(), - PAGE_SIZE_POST_CARD_SMALL: z.number(), - MORE_POSTS_COUNT: z.number(), - DEFAULT_MODE: z.enum(modeValues), // check that theme and mode match - DEFAULT_THEME: z.enum(themeValues), - AUTHOR_NAME: z.string().min(1), - AUTHOR_EMAIL: z.string().email(), - AUTHOR_GITHUB: z.string().url(), - AUTHOR_LINKEDIN: z.string().url(), - AUTHOR_TWITTER: z.string().url(), - AUTHOR_YOUTUBE: z.string().url(), - REPO_URL: z.string().url(), - }) -); +export const configClientSchema = processEnvSchema + .pick({ SITE_URL: true, PLAUSIBLE_SCRIPT_URL: true }) + .merge( + z.object({ + SITE_TITLE: z.string().min(1), + SITE_DESCRIPTION: z.string().min(1), + PAGE_SIZE_POST_CARD: z.number(), + PAGE_SIZE_POST_CARD_SMALL: z.number(), + MORE_POSTS_COUNT: z.number(), + DEFAULT_MODE: z.enum(modeValues), // check that theme and mode match + DEFAULT_THEME: z.enum(themeValues), + AUTHOR_NAME: z.string().min(1), + AUTHOR_EMAIL: z.string().email(), + AUTHOR_GITHUB: z.string().url(), + AUTHOR_LINKEDIN: z.string().url(), + AUTHOR_TWITTER: z.string().url(), + AUTHOR_YOUTUBE: z.string().url(), + REPO_URL: z.string().url(), + }) + );