-
-
Notifications
You must be signed in to change notification settings - Fork 221
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
54c355a
commit 40ce79a
Showing
19 changed files
with
201 additions
and
175 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
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
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
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
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 |
---|---|---|
@@ -1,50 +1,56 @@ | ||
import React from 'react'; | ||
import Head from 'next/head'; | ||
import { getLayout } from '~/components/Sidebar'; | ||
import fs from 'fs'; | ||
import matter from 'gray-matter'; | ||
import StyledMarkdown from '~/components/StyledMarkdown'; | ||
import getStaticMarkdownPaths from '~/lib/getStaticMarkdownPaths'; | ||
import getStaticMarkdownProps from '~/lib/getStaticMarkdownProps'; | ||
import { Headline1 } from '~/components/Headlines'; | ||
import { SectionContext } from '~/context'; | ||
import DocTable from '~/components/DocTable'; | ||
import { Headline1 } from '~/components/Headlines'; | ||
import { DocsHelp } from '~/components/DocsHelp'; | ||
import { TableOfContentMarkdown } from '~/components/StyledMarkdown'; | ||
export async function getStaticPaths() { | ||
return getStaticMarkdownPaths('pages/draft/2020-12'); | ||
} | ||
export async function getStaticProps(args: any) { | ||
return getStaticMarkdownProps(args, 'pages/draft/2020-12'); | ||
|
||
export async function getStaticProps() { | ||
const index = fs.readFileSync('pages/draft/2019-09/index.md', 'utf-8'); | ||
const { content: indexContent, data: indexData } = matter(index); | ||
|
||
const frontmatter = { ...indexData }; | ||
return { | ||
props: { | ||
blocks: { | ||
index: indexContent, | ||
}, | ||
frontmatter, | ||
}, | ||
}; | ||
} | ||
|
||
export default function StaticMarkdownPage({ | ||
export default function ImplementationsPages({ | ||
blocks, | ||
frontmatter, | ||
content, | ||
}: { | ||
blocks: any; | ||
frontmatter: any; | ||
content: any; | ||
}) { | ||
const markdownFile = '_index'; | ||
const newTitle = 'JSON Schema - ' + frontmatter.title; | ||
|
||
return ( | ||
<SectionContext.Provider value={frontmatter.section || null}> | ||
<div className="flex pt-4"> | ||
<div className="w-full pr-5"> | ||
<Head> | ||
<title>{newTitle}</title> | ||
</Head> | ||
<Headline1>{frontmatter.title}</Headline1> | ||
<StyledMarkdown markdown={content} /> | ||
<DocsHelp markdownFile={markdownFile} /> | ||
</div> | ||
<div className="w-2/5 lg:block mt-10 hidden sticky top-24 h-[calc(100vh-6rem)] overflow-hidden"> | ||
<div className="h-full overflow-y-auto scrollbar-hidden pl-5"> | ||
<div className="uppercase text-xs text-slate-400 mb-4">On this page</div> | ||
<TableOfContentMarkdown markdown={content} depth={3} /> | ||
<SectionContext.Provider value={null}> | ||
<div className='flex pt-4'> | ||
<div className='w-full pr-5'> | ||
<Headline1>{frontmatter.title}</Headline1> | ||
<DocTable frontmatter={frontmatter} /> | ||
<StyledMarkdown markdown={blocks.index} /> | ||
<DocsHelp /> | ||
</div> | ||
<div className='w-2/5 lg:block mt-10 hidden sticky top-24 h-[calc(100vh-6rem)] overflow-hidden'> | ||
<div className='h-full overflow-y-auto scrollbar-hidden pl-5'> | ||
<div className='uppercase text-xs text-slate-400 mb-4'> | ||
On this page | ||
</div> | ||
<TableOfContentMarkdown markdown={blocks.index} depth={3} /> | ||
</div> | ||
</div> | ||
</div> | ||
</SectionContext.Provider> | ||
|
||
); | ||
} | ||
StaticMarkdownPage.getLayout = getLayout; | ||
|
||
ImplementationsPages.getLayout = getLayout; |
Oops, something went wrong.