Skip to content

Commit d431d4d

Browse files
authored
feat: allow custom src/pages/index.astro (stackblitz#93)
1 parent 5ed17c4 commit d431d4d

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

packages/astro/src/index.ts

+11-6
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ export interface Options {
1515
*
1616
* Set this to false to customize the pages.
1717
*
18+
* Use 'tutorial-only' to only inject the tutorial routes. This is useful
19+
* if you want to have a different landing page.
20+
*
1821
* @default true
1922
*/
20-
defaultRoutes?: boolean;
23+
defaultRoutes?: boolean | 'tutorial-only';
2124

2225
/**
2326
* The value of the Cross-Origin-Embedder-Policy header for the dev server.
@@ -96,11 +99,13 @@ export default function createPlugin({ defaultRoutes = true, isolation, enterpri
9699
updateMarkdownConfig(options);
97100

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

105110
injectRoute({
106111
pattern: '[...slug]',

0 commit comments

Comments
 (0)