Some cleanup, and change to how config options are

This commit is contained in:
Adam Matthiesen 2024-03-03 10:25:51 -08:00
parent 017e641afd
commit 65f3f2b019
3 changed files with 36 additions and 27 deletions

View File

@ -62,23 +62,26 @@ export default defineConfig({
integrations: [
GhostCMS({
// Config Options
ghostURL: "http://example.com"; // Recommended to set here, Can also set in .env as CONTENT_API_URL
ghostURL: "http://example.com", // Recommended to set here, Can also set in .env as CONTENT_API_URL
ThemeProvider: { // Allows you to pass config options to our ThemeProvider if enabled.
disableThemeProvider: false; // OPTIONAL - Default False
theme: "@matthiesenxyz/astro-ghostcms-theme-default"; // OPTIONAL - Default Theme shown.
disableThemeProvider: false, // OPTIONAL - Default False
theme: "@matthiesenxyz/astro-ghostcms-theme-default", // OPTIONAL - Default Theme shown.
};
disableDefault404: false; // Allows the user to disable the default `/404 page, to be able to create their own under `/src/pages/404.astro`.
enableRSSFeed: true; // Allows the user to Enable or disable RSS Feed Generation. Default: true
enableOGImages: true; // Allows the user to Enable or disable OG Image Generation. Default: true
fullConsoleLogs: false; // Show the full Log output from All parts of Astro-GhostCMS
robotsTxt: {
// OPTIONAL
// ADVANCED USAGE - https://www.npmjs.com/package/astro-robots-txt#configuration
}
sitemap: {
// OPTIONAL
// ADVANCED USAGE - https://docs.astro.build/en/guides/integrations-guide/sitemap
}
disableDefault404: false, // Allows the user to disable the default `/404 page, to be able to create their own under `/src/pages/404.astro`.
enableRSSFeed: true, // Allows the user to Enable or disable RSS Feed Generation. Default: true
enableOGImages: true, // Allows the user to Enable or disable OG Image Generation. Default: true
fullConsoleLogs: false, // Show the full Log output from All parts of Astro-GhostCMS
Integrations: {
// This allows user config passthrough from Astro-GhostCMS to the Included Integrations
robotsTxt: {
// OPTIONAL
// ADVANCED USAGE - https://www.npmjs.com/package/astro-robots-txt#configuration
},
sitemap: {
// OPTIONAL
// ADVANCED USAGE - https://docs.astro.build/en/guides/integrations-guide/sitemap
},
},
})
],
});

View File

@ -162,7 +162,7 @@ export default defineIntegration({
),
);
}
addIntegration(sitemap(options.sitemap));
addIntegration(sitemap(options.Integrations?.sitemap));
} else {
if (verbose) {
GhostIntegrationLogger.info(
@ -181,7 +181,7 @@ export default defineIntegration({
),
);
}
addIntegration(robotsTxt(options.robotsTxt));
addIntegration(robotsTxt(options.Integrations?.robotsTxt));
} else {
if (verbose) {
GhostIntegrationLogger.info(

View File

@ -41,18 +41,24 @@ export const GhostUserConfigSchema = z.object({
* @default true
*/
fullConsoleLogs: z.boolean().optional().default(false),
/** Optional - astro-robots-txt
* This option allows the user to configure the included integration
/** OPTIONAL - Integrations Configuration
* This option allows the user to configure the included integrations
* Options shown are the availble options
* @see https://www.npmjs.com/package/astro-robots-txt#configuration
*/
robotsTxt: z.custom<RobotsTxtOptions>().optional(),
/** OPTIONAL - astrojs/sitemap
* This option allows the user to configure the included integration
* Options shown are the availble options
* @see https://docs.astro.build/en/guides/integrations-guide/sitemap
*/
sitemap: z.custom<SitemapOptions>().optional(),
Integrations: z.object({
/** Optional - astro-robots-txt
* This option allows the user to configure the included integration
* Options shown are the availble options
* @see https://www.npmjs.com/package/astro-robots-txt#configuration
*/
robotsTxt: z.custom<RobotsTxtOptions>().optional(),
/** OPTIONAL - astrojs/sitemap
* This option allows the user to configure the included integration
* Options shown are the availble options
* @see https://docs.astro.build/en/guides/integrations-guide/sitemap
*/
sitemap: z.custom<SitemapOptions>().optional(),
}).optional(),
});
/** USER CONFIGURATION SCHEMA */