This repository has been archived by the owner on Mar 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from zephraph/support-next-ssg
Add support for exporting ssg hooks
- Loading branch information
Showing
13 changed files
with
9,322 additions
and
1,217 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
__tests__/fixtures/extend-frontmatter-async/layouts/docs-page.jsx
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,20 @@ | ||
import { frontMatter as introData } from '../pages/docs/intro.mdx' | ||
import { frontMatter as advancedData } from '../pages/docs/advanced.mdx' | ||
|
||
export default frontMatter => { | ||
return function docsPageLayout({ children }) { | ||
return ( | ||
<> | ||
<p>LAYOUT TEMPLATE</p> | ||
<h1>{frontMatter.title}</h1> | ||
<p> | ||
All frontMatter: {JSON.stringify(frontMatter)} | ||
</p> | ||
<p> | ||
Other docs: {introData.title}, {advancedData.title} | ||
</p> | ||
{children} | ||
</> | ||
) | ||
} | ||
} |
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
__tests__/fixtures/extend-frontmatter-async/pages/docs/advanced.mdx
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,5 @@ | ||
--- | ||
title: 'Advanced Docs' | ||
--- | ||
|
||
This is some **advanced** docs content! |
6 changes: 6 additions & 0 deletions
6
__tests__/fixtures/extend-frontmatter-async/pages/docs/intro.mdx
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,6 @@ | ||
--- | ||
layout: 'docs-page' | ||
title: 'Intro Docs' | ||
--- | ||
|
||
Here's some _introductory_ docs content |
14 changes: 14 additions & 0 deletions
14
__tests__/fixtures/extend-frontmatter-async/pages/index.jsx
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,14 @@ | ||
import { frontMatter as introData } from './docs/intro.mdx' | ||
import { frontMatter as advancedData } from './docs/advanced.mdx' | ||
|
||
export default () => { | ||
return ( | ||
<> | ||
<p>Hello world</p> | ||
<ul> | ||
<li>{introData.title}</li> | ||
<li>{advancedData.title}</li> | ||
</ul> | ||
</> | ||
) | ||
} |
17 changes: 17 additions & 0 deletions
17
__tests__/fixtures/layout-exports-ssg/layouts/docs-page.jsx
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,17 @@ | ||
import { frontMatter as other} from '../pages/docs/intro.mdx' | ||
|
||
export async function getStaticProps() { | ||
return {props: {}} | ||
} | ||
|
||
export default (frontMatter) => { | ||
return function docsPageLayout({ children }) { | ||
return ( | ||
<> | ||
<p>LAYOUT TEMPLATE</p> | ||
<h1>{frontMatter.title}</h1> | ||
{children} | ||
</> | ||
) | ||
} | ||
} |
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,3 @@ | ||
const withMdxEnhanced = require('../../..') | ||
|
||
module.exports = withMdxEnhanced()() |
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,6 @@ | ||
--- | ||
layout: 'docs-page' | ||
title: 'Intro Docs' | ||
--- | ||
|
||
Hello world |
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
Oops, something went wrong.