From dcde575e8e15b12bdbb8fdc58bcbf76005862e35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B2an?= Date: Mon, 24 Jun 2024 16:12:09 +0000 Subject: [PATCH 1/3] feat: make it possible to have a custom src/pages/index.astro --- packages/astro/src/index.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/astro/src/index.ts b/packages/astro/src/index.ts index 17e24e004..4c82803c1 100644 --- a/packages/astro/src/index.ts +++ b/packages/astro/src/index.ts @@ -15,9 +15,9 @@ export interface Options { * * Set this to false to customize the pages. * - * @default true + * @default 'all' */ - defaultRoutes?: boolean; + defaultRoutes?: boolean | 'tutorial-only'; /** * The value of the Cross-Origin-Embedder-Policy header for the dev server. @@ -96,11 +96,13 @@ export default function createPlugin({ defaultRoutes = true, isolation, enterpri updateMarkdownConfig(options); if (defaultRoutes) { - injectRoute({ - pattern: '/', - entrypoint: '@tutorialkit/astro/default/pages/index.astro', - prerender: true, - }); + if (defaultRoutes !== 'tutorial-only') { + injectRoute({ + pattern: '/', + entrypoint: '@tutorialkit/astro/default/pages/index.astro', + prerender: true, + }); + } injectRoute({ pattern: '[...slug]', From c14fc7850e6087b2fb510561e60480b5ed3ad8ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B2an?= Date: Tue, 25 Jun 2024 15:39:48 +0100 Subject: [PATCH 2/3] Update packages/astro/src/index.ts --- packages/astro/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/astro/src/index.ts b/packages/astro/src/index.ts index 4c82803c1..21297a5cd 100644 --- a/packages/astro/src/index.ts +++ b/packages/astro/src/index.ts @@ -15,7 +15,7 @@ export interface Options { * * Set this to false to customize the pages. * - * @default 'all' + * @default true */ defaultRoutes?: boolean | 'tutorial-only'; From e6f3ca8db26b57bba0a326393806a1e913e68743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B2an?= Date: Wed, 26 Jun 2024 09:53:28 +0000 Subject: [PATCH 3/3] fix: document the effect of the new value --- packages/astro/src/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/astro/src/index.ts b/packages/astro/src/index.ts index 21297a5cd..6910fdc18 100644 --- a/packages/astro/src/index.ts +++ b/packages/astro/src/index.ts @@ -15,6 +15,9 @@ export interface Options { * * Set this to false to customize the pages. * + * Use 'tutorial-only' to only inject the tutorial routes. This is useful + * if you want to have a different landing page. + * * @default true */ defaultRoutes?: boolean | 'tutorial-only';