File tree Expand file tree Collapse file tree 4 files changed +24
-19
lines changed Expand file tree Collapse file tree 4 files changed +24
-19
lines changed Original file line number Diff line number Diff line change 1
- const pages = import . meta. glob ( "#{__PLUGIN_PAGES_ROOT}" ) ;
1
+ const pages = import . meta. glob ( "#{__PLUGIN_PAGES_ROOT}" , { eager : false } ) ;
2
2
3
3
export const routes = normalizeRouteImports ( pages , [
4
4
new RegExp ( "#{__PLUGIN_PAGES_ROOT_REGEX}" ) ,
Original file line number Diff line number Diff line change 1
- import { lazy } from "preact-iso" ;
1
+ const contentMap = { } ;
2
+ const posts = import . meta. glob ( "./**/*.mdx" , { eager : true } ) ;
3
+ for ( let i in posts ) {
4
+ contentMap [ i ] = "default" in posts [ i ] ? posts [ i ] . default : posts [ i ] ;
5
+ }
2
6
3
7
export const sideBar = {
4
8
introduction : {
5
9
order : 1 ,
6
10
label : "Introduction" ,
7
- source : lazy ( ( ) => import ( "./introduction.mdx" ) ) ,
11
+ source : contentMap [ "./introduction.mdx" ] ,
8
12
key : "introduction" ,
9
13
} ,
10
14
essentials : {
11
15
order : 2 ,
12
16
label : "Essentials" ,
13
- source : lazy ( ( ) => import ( "./essentials.mdx" ) ) ,
17
+ source : contentMap [ "./essentials.mdx" ] ,
14
18
key : "essentials" ,
15
19
} ,
16
20
aesthetics : {
17
21
order : 3 ,
18
22
label : "Aesthetics" ,
19
- source : lazy ( ( ) => import ( "./aesthetics.mdx" ) ) ,
23
+ source : contentMap [ "./aesthetics.mdx" ] ,
20
24
key : "aesthetics" ,
21
25
} ,
22
26
"developer-experience" : {
23
27
order : 4 ,
24
28
label : "Developer Experience" ,
25
- source : lazy ( ( ) => import ( "./developer-experience.mdx" ) ) ,
29
+ source : contentMap [ "./developer-experience.mdx" ] ,
26
30
key : "developer-experience" ,
27
31
} ,
28
32
frameworks : {
29
33
order : 5 ,
30
34
label : "Frameworks" ,
31
- source : lazy ( ( ) => import ( "./frameworks.mdx" ) ) ,
35
+ source : contentMap [ "./frameworks.mdx" ] ,
32
36
key : "frameworks" ,
33
37
} ,
34
38
templates : {
35
39
order : 6 ,
36
40
label : "Templates" ,
37
- source : lazy ( ( ) => import ( "./templates.mdx" ) ) ,
41
+ source : contentMap [ "./templates.mdx" ] ,
38
42
key : "templates" ,
39
43
} ,
40
44
} ;
Original file line number Diff line number Diff line change 1
- import { hydrate , render } from "preact" ;
1
+ import { render } from "preact" ;
2
2
import {
3
3
ErrorBoundary ,
4
4
LocationProvider ,
5
5
Route ,
6
6
Router ,
7
7
lazy ,
8
8
prerender as ssr ,
9
+ hydrate ,
9
10
} from "preact-iso" ;
10
11
import { routes } from "~routes" ;
11
12
import "./index.css" ;
Original file line number Diff line number Diff line change 1
- import { lazy } from "preact-iso" ;
2
1
import { sideBar } from "../content/data" ;
3
2
import BaseLayout from "../layouts/base" ;
4
- import { Suspense } from "preact/compat" ;
5
3
6
- const AllContent = ( ) =>
7
- Object . keys ( sideBar ) . map ( ( d , i ) => {
4
+ const AllContent = ( ) => {
5
+ const components = [ ] ;
6
+ let i = - 1 ;
7
+ for ( let d in sideBar ) {
8
+ i ++ ;
8
9
const Component = sideBar [ d ] . source ;
9
10
const classList = i > 0 ? "mt-12 pt-12" : "" ;
10
- return (
11
- < Suspense fallback = { < div > Loading...</ div > } >
12
- < Component class = { classList } />
13
- </ Suspense >
14
- ) ;
15
- } ) ;
11
+ components . push ( < Component class = { classList } /> ) ;
12
+ }
13
+
14
+ return components ;
15
+ } ;
16
16
17
17
export default function HomePage ( ) {
18
18
return (
You can’t perform that action at this time.
0 commit comments