-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5da41b3
commit daad1a1
Showing
12 changed files
with
606 additions
and
338 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
Large diffs are not rendered by default.
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,53 @@ | ||
import React from 'react' | ||
|
||
import { Page } from '../../components' | ||
import DataProviderDocs from '../../templates/documentation/data-providers-guide' | ||
|
||
import retrieveContent from 'content' | ||
|
||
const ASSETS_BASE_URL = 'https://oacore.github.io/content/' | ||
|
||
const setAssetsUrl = (object) => | ||
Object.entries(object).forEach(([, value]) => { | ||
delete value.membership | ||
if (value.images) { | ||
Object.entries(value.images).forEach(([, item]) => { | ||
item.file = ASSETS_BASE_URL + item.file | ||
}) | ||
} | ||
}) | ||
|
||
const getProviderSections = async ({ ref } = {}) => { | ||
const content = await retrieveContent('docs-dataProvider', { | ||
ref, | ||
transform: 'object', | ||
}) | ||
|
||
Object.values(content).forEach((section) => { | ||
if (section.items) setAssetsUrl(section.items) | ||
}) | ||
return content | ||
} | ||
|
||
export async function getStaticProps({ previewData }) { | ||
const ref = previewData?.ref | ||
const sectionProvider = await getProviderSections({ ref }) | ||
|
||
const dataProvider = { | ||
...sectionProvider, | ||
} | ||
|
||
return { | ||
props: { | ||
dataProvider, | ||
}, | ||
} | ||
} | ||
|
||
const DocumentationPage = ({ dataProvider }) => ( | ||
<Page> | ||
<DataProviderDocs {...dataProvider} /> | ||
</Page> | ||
) | ||
|
||
export default DocumentationPage |
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,53 @@ | ||
import React from 'react' | ||
|
||
import { Page } from '../../components' | ||
import DocumentationPageTemplate from '../../templates/documentation/membership-documentation' | ||
|
||
import retrieveContent from 'content' | ||
|
||
const ASSETS_BASE_URL = 'https://oacore.github.io/content/' | ||
|
||
const setAssetsUrl = (object) => | ||
Object.entries(object).forEach(([, value]) => { | ||
delete value.membership | ||
if (value.images) { | ||
Object.entries(value.images).forEach(([, item]) => { | ||
item.file = ASSETS_BASE_URL + item.file | ||
}) | ||
} | ||
}) | ||
|
||
const getSections = async ({ ref } = {}) => { | ||
const content = await retrieveContent('docs-membership', { | ||
ref, | ||
transform: 'object', | ||
}) | ||
|
||
delete content.headerDashboard | ||
Object.values(content).forEach((section) => { | ||
if (section.items) setAssetsUrl(section.items) | ||
}) | ||
return content | ||
} | ||
|
||
export async function getStaticProps({ previewData }) { | ||
const ref = previewData?.ref | ||
const sections = await getSections({ ref }) | ||
const data = { | ||
...sections, | ||
} | ||
|
||
return { | ||
props: { | ||
data, | ||
}, | ||
} | ||
} | ||
|
||
const DocumentationPage = ({ data }) => ( | ||
<Page title={data.meta.title} description={data.meta.description}> | ||
<DocumentationPageTemplate {...data} /> | ||
</Page> | ||
) | ||
|
||
export default DocumentationPage |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.