add checkIntegration helper for sitemap and astro-robots-txt
This commit is contained in:
parent
41b0ce75d3
commit
aea8305ac0
|
@ -15,8 +15,8 @@ import latestVersion from "./utils/latestVersion";
|
||||||
import sitemap from "@astrojs/sitemap";
|
import sitemap from "@astrojs/sitemap";
|
||||||
import robotsTxt from "astro-robots-txt";
|
import robotsTxt from "astro-robots-txt";
|
||||||
|
|
||||||
import ghostRSS from "./integrations/rssfeed";
|
|
||||||
// Internal Integrations
|
// Internal Integrations
|
||||||
|
import ghostRSS from "./integrations/rssfeed";
|
||||||
import ghostOGImages from "./integrations/satoriog";
|
import ghostOGImages from "./integrations/satoriog";
|
||||||
import ghostThemeProvider from "./integrations/themeprovider";
|
import ghostThemeProvider from "./integrations/themeprovider";
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ const ENV = loadEnv("all", process.cwd(), "CONTENT_API");
|
||||||
|
|
||||||
// Import User Configuration Zod Schema
|
// Import User Configuration Zod Schema
|
||||||
import { GhostUserConfigSchema } from "./schemas/userconfig";
|
import { GhostUserConfigSchema } from "./schemas/userconfig";
|
||||||
|
import type { AstroIntegration } from "astro";
|
||||||
|
|
||||||
/** Astro-GhostCMS Integration
|
/** Astro-GhostCMS Integration
|
||||||
* @description This integration allows you to use GhostCMS as a headless CMS for your Astro project
|
* @description This integration allows you to use GhostCMS as a headless CMS for your Astro project
|
||||||
|
@ -168,21 +169,25 @@ export default defineIntegration({
|
||||||
intLogInfo(c.gray("RSS Feed is disabled"));
|
intLogInfo(c.gray("RSS Feed is disabled"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ASTROJS/SITEMAP
|
const checkIntegration = (name: string, integration: AstroIntegration) => {
|
||||||
if (!hasIntegration("@astrojs/sitemap")) {
|
if (!hasIntegration(name)) {
|
||||||
intLogInfo(c.bold(c.magenta(`Adding ${c.blue("@astrojs/sitemap")} integration`)));
|
intLogInfo(c.bold(c.magenta(`Adding ${c.blue(name)} integration`)));
|
||||||
addIntegration(sitemap(options.Integrations?.sitemap));
|
addIntegration(integration);
|
||||||
} else {
|
} else {
|
||||||
intLogInfo(c.gray("@astrojs/sitemap integration already exists, skipping..."));
|
intLogInfo(c.gray(`${name} integration already exists, skipping...`));
|
||||||
}
|
}
|
||||||
// ASTRO-ROBOTS-TXT
|
|
||||||
if (!hasIntegration("astro-robots-txt")) {
|
|
||||||
intLogInfo(c.bold(c.magenta(`Adding ${c.blue("astro-robots-txt")} integration`)));
|
|
||||||
addIntegration(robotsTxt(options.Integrations?.robotsTxt));
|
|
||||||
} else {
|
|
||||||
intLogInfo(c.gray("astro-robots-txt integration already exists, skipping..."));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkIntegration(
|
||||||
|
"@astrojs/sitemap",
|
||||||
|
sitemap(options.Integrations?.sitemap)
|
||||||
|
);
|
||||||
|
checkIntegration(
|
||||||
|
"astro-robots-txt",
|
||||||
|
robotsTxt(options.Integrations?.robotsTxt)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
// Set up default 404 page
|
// Set up default 404 page
|
||||||
if (!options.disableDefault404) {
|
if (!options.disableDefault404) {
|
||||||
routeLogInfo(c.bold(c.cyan("Setting up default 404 page")));
|
routeLogInfo(c.bold(c.cyan("Setting up default 404 page")));
|
||||||
|
|
|
@ -14,7 +14,7 @@ export default defineConfig({
|
||||||
ThemeProvider: {
|
ThemeProvider: {
|
||||||
theme: "@matthiesenxyz/astro-ghostcms-brutalbyelian",
|
theme: "@matthiesenxyz/astro-ghostcms-brutalbyelian",
|
||||||
},
|
},
|
||||||
verbose: false,
|
verbose: true,
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue