From bbddc699de3d7631fdd1edac81b68f3a62bfa76d Mon Sep 17 00:00:00 2001 From: Adam Matthiesen Date: Fri, 26 Jan 2024 05:10:34 -0800 Subject: [PATCH] up --- packages/astro-ghostcms/index.ts | 2 +- packages/astro-ghostcms/src/schemas/index.ts | 11 ++++++----- playground/astro.config.mjs | 11 ++++++++--- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/packages/astro-ghostcms/index.ts b/packages/astro-ghostcms/index.ts index 6228b76d..d4a1c3ec 100644 --- a/packages/astro-ghostcms/index.ts +++ b/packages/astro-ghostcms/index.ts @@ -72,7 +72,7 @@ export default function GhostCMS(options: UserConfig): AstroIntegration { if (!GhostUserConfig.success) { const validationError = fromZodError((GhostUserConfig as unknown as SafeParseError).error); logger.error(`Config Error - ${ validationError }`); - throw validationError; + throw Error(""); } const GhostConfig = GhostUserConfig.data; const GCD = { diff --git a/packages/astro-ghostcms/src/schemas/index.ts b/packages/astro-ghostcms/src/schemas/index.ts index e8dd0846..aa294dcc 100644 --- a/packages/astro-ghostcms/src/schemas/index.ts +++ b/packages/astro-ghostcms/src/schemas/index.ts @@ -7,12 +7,13 @@ export const UserConfigSchema = z.object({ * @example * // https://astro.build/config * export default defineConfig({ - * site: "https://demo.astro-ghostcms.xyz/", - * integrations: [ghostcms({ - * ghostURL: "https://ghostdemo.matthiesen.xyz" - * })], + * integrations: [ + * ghostcms({ + * ghostURL: "https://ghostdemo.matthiesen.xyz" + * }) + * ], * }); */ - ghostURL: z.string().optional(), + ghostURL: z.string().url().optional(), /** OPTIONAL - Disable Route Injector * This option allows the user to disable the route injection system and utilize just the integraions other functions. Such as API, sitemap and robotstxt integrations. */ disableRouteInjection: z.boolean().default(false), diff --git a/playground/astro.config.mjs b/playground/astro.config.mjs index 8890e5d8..568027ae 100644 --- a/playground/astro.config.mjs +++ b/playground/astro.config.mjs @@ -4,7 +4,12 @@ import ghostcms from "@matthiesenxyz/astro-ghostcms"; // https://astro.build/config export default defineConfig({ site: "https://demo.astro-ghostcms.xyz/", - integrations: [ ghostcms({ - ghostURL: "https://ghostdemo.matthiesen.xyz" - })], + integrations: [ + ghostcms({ + disableConsoleOutput: true, + disableRouteInjection: false, + theme: "@matthiesenxyz/astro-ghostcms-theme-default", + ghostURL: "https://ghostdemo.matthiesen.xyz", + }) + ], });