ghostcms is now astro output aware

This commit is contained in:
Adam Matthiesen 2024-01-18 01:43:23 -08:00
parent 3d2a3e560f
commit d034e593c8
2 changed files with 28 additions and 3 deletions

View File

@ -8,43 +8,68 @@ export default function GhostCMS(): AstroIntegration {
injectRoute,
logger,
}) => {
logger.info("Injecting Route: /")
injectRoute({
pattern: '/',
entrypoint: '@matthiesenxyz/astro-ghostcms/index.astro'
})
logger.info("Injecting Route: /[slug]")
injectRoute({
pattern: '/[slug]',
entrypoint: '@matthiesenxyz/astro-ghostcms/[slug].astro'
})
logger.info("Injecting Route: /tags")
injectRoute({
pattern: '/tags',
entrypoint: '@matthiesenxyz/astro-ghostcms/tags.astro'
})
logger.info("Injecting Route: /authors")
injectRoute({
pattern: '/authors',
entrypoint: '@matthiesenxyz/astro-ghostcms/authors.astro'
})
logger.info("Injecting Route: /tag/[slug]")
injectRoute({
pattern: '/tag/[slug]',
entrypoint: '@matthiesenxyz/astro-ghostcms/tag/[slug].astro'
})
logger.info("Injecting Route: /author/[slug]")
injectRoute({
pattern: '/author/[slug]',
entrypoint: '@matthiesenxyz/astro-ghostcms/author/[slug].astro'
})
logger.info("Injecting Route: /archives/[...page]")
injectRoute({
pattern: '/archives/[...page]',
entrypoint: '@matthiesenxyz/astro-ghostcms/archives/[...page].astro'
})
logger.info('Astro GhostCMS Plugin Loaded!')
},
'astro:config:done': async ({
config,
logger,
}) => {
if (config.output === "server"){
logger.error("This integration is not yet ready to be used in 'output: server' mode, to prevent issues please switch to static.")
} else if (config.output === "hybrid"){
logger.error("This integration is not yet ready to be used in 'output: hybrid' mode, to prevent issues please switch to static.")
}else {
logger.info('GhostCMS Routes Injected. Integration is now ready.')
}
}
}
}

View File

@ -1,7 +1,7 @@
{
"name": "@matthiesenxyz/astro-ghostcms",
"description": "Astro GhostCMS integration to allow easier importing of GhostCMS Content",
"version": "2.0.4",
"version": "2.0.5",
"author": "MatthiesenXYZ (https://matthiesen.xyz)",
"type": "module",
"license": "MIT",