change `else { if() ` to `else if`

This commit is contained in:
Adam Matthiesen 2024-03-04 09:09:09 -08:00
parent 1350532de4
commit 03c1de5591
1 changed files with 6 additions and 18 deletions

View File

@ -136,31 +136,25 @@ export default defineIntegration({
verbose, verbose,
}), }),
); );
} else { } else if (verbose) {
if (verbose) {
GhostIntegrationLogger.info(c.gray("Theme Provider is disabled")); GhostIntegrationLogger.info(c.gray("Theme Provider is disabled"));
} }
}
// Satori OG Images // Satori OG Images
if (options.enableOGImages) { if (options.enableOGImages) {
addIntegration(ghostOGImages({ verbose })); addIntegration(ghostOGImages({ verbose }));
} else { } else if (verbose) {
if (verbose) {
GhostIntegrationLogger.info( GhostIntegrationLogger.info(
c.gray("OG Image Provider is disabled"), c.gray("OG Image Provider is disabled"),
); );
} }
}
// RSS Feed // RSS Feed
if (options.enableRSSFeed) { if (options.enableRSSFeed) {
addIntegration(ghostRSS({ verbose })); addIntegration(ghostRSS({ verbose }));
} else { } else if (verbose) {
if (verbose) {
GhostIntegrationLogger.info(c.gray("RSS Feed is disabled")); GhostIntegrationLogger.info(c.gray("RSS Feed is disabled"));
} }
}
// @ASTROJS/SITEMAP // @ASTROJS/SITEMAP
if (!hasIntegration("@astrojs/sitemap")) { if (!hasIntegration("@astrojs/sitemap")) {
@ -172,15 +166,13 @@ export default defineIntegration({
); );
} }
addIntegration(sitemap(options.Integrations?.sitemap)); addIntegration(sitemap(options.Integrations?.sitemap));
} else { } else if (verbose) {
if (verbose) {
GhostIntegrationLogger.info( GhostIntegrationLogger.info(
c.gray( c.gray(
"@astrojs/sitemap integration already exists, skipping...", "@astrojs/sitemap integration already exists, skipping...",
), ),
); );
} }
}
// ASTRO-ROBOTS-TXT // ASTRO-ROBOTS-TXT
if (!hasIntegration("astro-robots-txt")) { if (!hasIntegration("astro-robots-txt")) {
if (verbose) { if (verbose) {
@ -191,15 +183,13 @@ export default defineIntegration({
); );
} }
addIntegration(robotsTxt(options.Integrations?.robotsTxt)); addIntegration(robotsTxt(options.Integrations?.robotsTxt));
} else { } else if (verbose) {
if (verbose) {
GhostIntegrationLogger.info( GhostIntegrationLogger.info(
c.gray( c.gray(
"astro-robots-txt integration already exists, skipping...", "astro-robots-txt integration already exists, skipping...",
), ),
); );
} }
}
// Set up default 404 page // Set up default 404 page
if (!options.disableDefault404) { if (!options.disableDefault404) {
@ -213,13 +203,11 @@ export default defineIntegration({
entrypoint: `${name}/404.astro`, entrypoint: `${name}/404.astro`,
prerender: true, prerender: true,
}); });
} else { } else if (verbose) {
if (verbose) {
GhostRouteLogger.info( GhostRouteLogger.info(
c.gray("Default 404 page is disabled, Skipping..."), c.gray("Default 404 page is disabled, Skipping..."),
); );
} }
}
// Add virtual imports for user configuration // Add virtual imports for user configuration
addVirtualImports({ addVirtualImports({