valaxy 0.17.0 → 0.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/client/main.ts CHANGED
@@ -36,12 +36,21 @@ routes.forEach((i) => {
36
36
  })
37
37
  })
38
38
 
39
+ // filter children recursive
40
+ function filterDraft(routes: any[]) {
41
+ return routes.filter((i) => {
42
+ if (i.children)
43
+ i.children = filterDraft(i.children)
44
+
45
+ return !i.meta?.frontmatter?.draft
46
+ })
47
+ }
48
+
39
49
  // not filter hide for ssg
40
50
  const routesWithLayout = setupLayouts(import.meta.env.DEV
41
51
  ? routes
42
- : routes.filter(i =>
43
- i.meta && i.meta.frontmatter && !i.meta.frontmatter.draft,
44
- ))
52
+ : filterDraft(routes),
53
+ )
45
54
 
46
55
  // https://github.com/antfu/vite-ssg
47
56
  export const createApp = ViteSSG(