This commit is contained in:
Adam Matthiesen 2024-01-26 05:10:34 -08:00
parent b16694debe
commit bbddc699de
3 changed files with 15 additions and 9 deletions

View File

@ -72,7 +72,7 @@ export default function GhostCMS(options: UserConfig): AstroIntegration {
if (!GhostUserConfig.success) { if (!GhostUserConfig.success) {
const validationError = fromZodError((GhostUserConfig as unknown as SafeParseError<UserConfig>).error); const validationError = fromZodError((GhostUserConfig as unknown as SafeParseError<UserConfig>).error);
logger.error(`Config Error - ${ validationError }`); logger.error(`Config Error - ${ validationError }`);
throw validationError; throw Error("");
} }
const GhostConfig = GhostUserConfig.data; const GhostConfig = GhostUserConfig.data;
const GCD = { const GCD = {

View File

@ -7,12 +7,13 @@ export const UserConfigSchema = z.object({
* @example * @example
* // https://astro.build/config * // https://astro.build/config
* export default defineConfig({ * export default defineConfig({
* site: "https://demo.astro-ghostcms.xyz/", * integrations: [
* integrations: [ghostcms({ * ghostcms({
* ghostURL: "https://ghostdemo.matthiesen.xyz" * ghostURL: "https://ghostdemo.matthiesen.xyz"
* })], * })
* ],
* }); */ * }); */
ghostURL: z.string().optional(), ghostURL: z.string().url().optional(),
/** OPTIONAL - Disable Route Injector /** 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. */ * 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), disableRouteInjection: z.boolean().default(false),

View File

@ -4,7 +4,12 @@ import ghostcms from "@matthiesenxyz/astro-ghostcms";
// https://astro.build/config // https://astro.build/config
export default defineConfig({ export default defineConfig({
site: "https://demo.astro-ghostcms.xyz/", site: "https://demo.astro-ghostcms.xyz/",
integrations: [ ghostcms({ integrations: [
ghostURL: "https://ghostdemo.matthiesen.xyz" ghostcms({
})], disableConsoleOutput: true,
disableRouteInjection: false,
theme: "@matthiesenxyz/astro-ghostcms-theme-default",
ghostURL: "https://ghostdemo.matthiesen.xyz",
})
],
}); });