Skip to content

Commit dcde575

Browse files
committed
feat: make it possible to have a custom src/pages/index.astro
1 parent 6d01620 commit dcde575

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

packages/astro/src/index.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ export interface Options {
1515
*
1616
* Set this to false to customize the pages.
1717
*
18-
* @default true
18+
* @default 'all'
1919
*/
20-
defaultRoutes?: boolean;
20+
defaultRoutes?: boolean | 'tutorial-only';
2121

2222
/**
2323
* 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
9696
updateMarkdownConfig(options);
9797

9898
if (defaultRoutes) {
99-
injectRoute({
100-
pattern: '/',
101-
entrypoint: '@tutorialkit/astro/default/pages/index.astro',
102-
prerender: true,
103-
});
99+
if (defaultRoutes !== 'tutorial-only') {
100+
injectRoute({
101+
pattern: '/',
102+
entrypoint: '@tutorialkit/astro/default/pages/index.astro',
103+
prerender: true,
104+
});
105+
}
104106

105107
injectRoute({
106108
pattern: '[...slug]',

0 commit comments

Comments
 (0)