astro-ghostcms/index.ts

51 lines
1.6 KiB
TypeScript
Raw Permalink Normal View History

import type { AstroIntegration } from "astro"
export default function GhostCMS(): AstroIntegration {
return {
name: 'astro-ghostcms',
hooks: {
'astro:config:setup': async ({
injectRoute,
logger,
}) => {
injectRoute({
pattern: '/',
2024-01-17 10:29:47 +00:00
entrypoint: '@matthiesenxyz/astro-ghostcms/index.astro'
})
injectRoute({
pattern: '/[slug]',
2024-01-17 10:29:47 +00:00
entrypoint: '@matthiesenxyz/astro-ghostcms/[slug].astro'
})
injectRoute({
pattern: '/tags',
2024-01-17 10:29:47 +00:00
entrypoint: '@matthiesenxyz/astro-ghostcms/tags.astro'
})
injectRoute({
pattern: '/authors',
2024-01-17 10:29:47 +00:00
entrypoint: '@matthiesenxyz/astro-ghostcms/authors.astro'
})
injectRoute({
pattern: '/tag/[slug]',
2024-01-17 10:29:47 +00:00
entrypoint: '@matthiesenxyz/astro-ghostcms/tag/[slug].astro'
})
injectRoute({
pattern: '/author/[slug]',
2024-01-17 10:29:47 +00:00
entrypoint: '@matthiesenxyz/astro-ghostcms/author/[slug].astro'
})
injectRoute({
pattern: '/archives/[...page]',
2024-01-17 10:29:47 +00:00
entrypoint: '@matthiesenxyz/astro-ghostcms/archives/[...page].astro'
})
logger.info('Astro GhostCMS Plugin Loaded!')
}
}
}
}