Skip to content

Commit 417cf24

Browse files
feat: hide draft pages in production build
1 parent ee6b512 commit 417cf24

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

listSidebar.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export function walkDocsRecursive(dir: string): StarlightSidebarList {
4747
const parsed = matter(fileContent);
4848

4949
if (parsed.data.hideInSidebar && parsed.data.hideInSidebar === true) continue;
50+
if (import.meta.env.PROD && parsed.data.draft && parsed.data.draft === true) continue;
5051

5152
result.push(String(parsed.data.slug ?? ''));
5253
}

0 commit comments

Comments
 (0)