-
-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fs-router example and plugin fixes
- Loading branch information
1 parent
f99ddb9
commit b901d57
Showing
5 changed files
with
55 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { createPages } from 'waku'; | ||
import type { PathsForPages } from 'waku/router'; | ||
|
||
import _Layout from './pages/_layout'; | ||
import Bar from './pages/bar'; | ||
import FooIndex from './pages/foo/index'; | ||
import Index from './pages/index'; | ||
import Layout from './pages/layout'; | ||
import NestedSlugName from './pages/nested/[name]'; | ||
|
||
const _pages = createPages(async (pagesFns) => [ | ||
pagesFns.createLayout({ path: '/', component: _Layout, render: 'static' }), | ||
pagesFns.createPage({ path: '/bar', component: Bar, render: 'dynamic' }), | ||
pagesFns.createPage({ | ||
path: '/foo/', | ||
component: FooIndex, | ||
render: 'dynamic', | ||
}), | ||
pagesFns.createPage({ path: '/', component: Index, render: 'dynamic' }), | ||
pagesFns.createPage({ | ||
path: '/layout', | ||
component: Layout, | ||
render: 'dynamic', | ||
}), | ||
pagesFns.createPage({ | ||
path: '/nested/[name]', | ||
component: NestedSlugName, | ||
render: 'dynamic', | ||
}), | ||
]); | ||
|
||
declare module 'waku/router' { | ||
interface RouteConfig { | ||
paths: PathsForPages<typeof _pages>; | ||
} | ||
} | ||
|
||
export default _pages; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const Layout = () => ( | ||
<div> | ||
<h2>This is a page named Layout</h2> | ||
</div> | ||
); | ||
|
||
export default Layout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters