ghostcms is now astro output aware
This commit is contained in:
parent
3d2a3e560f
commit
d034e593c8
27
index.ts
27
index.ts
|
@ -9,42 +9,67 @@ export default function GhostCMS(): AstroIntegration {
|
||||||
logger,
|
logger,
|
||||||
}) => {
|
}) => {
|
||||||
|
|
||||||
|
logger.info("Injecting Route: /")
|
||||||
|
|
||||||
injectRoute({
|
injectRoute({
|
||||||
pattern: '/',
|
pattern: '/',
|
||||||
entrypoint: '@matthiesenxyz/astro-ghostcms/index.astro'
|
entrypoint: '@matthiesenxyz/astro-ghostcms/index.astro'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
logger.info("Injecting Route: /[slug]")
|
||||||
|
|
||||||
injectRoute({
|
injectRoute({
|
||||||
pattern: '/[slug]',
|
pattern: '/[slug]',
|
||||||
entrypoint: '@matthiesenxyz/astro-ghostcms/[slug].astro'
|
entrypoint: '@matthiesenxyz/astro-ghostcms/[slug].astro'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
logger.info("Injecting Route: /tags")
|
||||||
|
|
||||||
injectRoute({
|
injectRoute({
|
||||||
pattern: '/tags',
|
pattern: '/tags',
|
||||||
entrypoint: '@matthiesenxyz/astro-ghostcms/tags.astro'
|
entrypoint: '@matthiesenxyz/astro-ghostcms/tags.astro'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
logger.info("Injecting Route: /authors")
|
||||||
|
|
||||||
injectRoute({
|
injectRoute({
|
||||||
pattern: '/authors',
|
pattern: '/authors',
|
||||||
entrypoint: '@matthiesenxyz/astro-ghostcms/authors.astro'
|
entrypoint: '@matthiesenxyz/astro-ghostcms/authors.astro'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
logger.info("Injecting Route: /tag/[slug]")
|
||||||
|
|
||||||
injectRoute({
|
injectRoute({
|
||||||
pattern: '/tag/[slug]',
|
pattern: '/tag/[slug]',
|
||||||
entrypoint: '@matthiesenxyz/astro-ghostcms/tag/[slug].astro'
|
entrypoint: '@matthiesenxyz/astro-ghostcms/tag/[slug].astro'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
logger.info("Injecting Route: /author/[slug]")
|
||||||
|
|
||||||
injectRoute({
|
injectRoute({
|
||||||
pattern: '/author/[slug]',
|
pattern: '/author/[slug]',
|
||||||
entrypoint: '@matthiesenxyz/astro-ghostcms/author/[slug].astro'
|
entrypoint: '@matthiesenxyz/astro-ghostcms/author/[slug].astro'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
logger.info("Injecting Route: /archives/[...page]")
|
||||||
|
|
||||||
injectRoute({
|
injectRoute({
|
||||||
pattern: '/archives/[...page]',
|
pattern: '/archives/[...page]',
|
||||||
entrypoint: '@matthiesenxyz/astro-ghostcms/archives/[...page].astro'
|
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.')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "@matthiesenxyz/astro-ghostcms",
|
"name": "@matthiesenxyz/astro-ghostcms",
|
||||||
"description": "Astro GhostCMS integration to allow easier importing of GhostCMS Content",
|
"description": "Astro GhostCMS integration to allow easier importing of GhostCMS Content",
|
||||||
"version": "2.0.4",
|
"version": "2.0.5",
|
||||||
"author": "MatthiesenXYZ (https://matthiesen.xyz)",
|
"author": "MatthiesenXYZ (https://matthiesen.xyz)",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|
Loading…
Reference in New Issue