chore: update gatsby to v3 (#5057)
This commit is contained in:
27
website/src/components/blog-post-template.js
Normal file
27
website/src/components/blog-post-template.js
Normal file
@ -0,0 +1,27 @@
|
||||
import React from 'react';
|
||||
import { css } from '@emotion/core';
|
||||
|
||||
import Container from './container';
|
||||
import Markdown from './markdown';
|
||||
import MetaInfo from './meta-info';
|
||||
import Page from './page';
|
||||
|
||||
export default function BlogPostTemplate({ title, author, date, body, html }) {
|
||||
return (
|
||||
<Container size="sm">
|
||||
<Page as="article">
|
||||
<h1
|
||||
css={css`
|
||||
margin-bottom: 0;
|
||||
`}
|
||||
>
|
||||
{title}
|
||||
</h1>
|
||||
<MetaInfo>
|
||||
by {author} on {date}
|
||||
</MetaInfo>
|
||||
<Markdown body={body} html={html} />
|
||||
</Page>
|
||||
</Container>
|
||||
);
|
||||
}
|
42
website/src/components/docs-template.js
Normal file
42
website/src/components/docs-template.js
Normal file
@ -0,0 +1,42 @@
|
||||
import React from 'react';
|
||||
|
||||
import Container from './container';
|
||||
import SidebarLayout from './sidebar-layout';
|
||||
import EditLink from './edit-link';
|
||||
import Widgets from './widgets';
|
||||
import Markdown from './markdown';
|
||||
import DocsNav from './docs-nav';
|
||||
|
||||
function DocsSidebar({ docsNav, location }) {
|
||||
return (
|
||||
<aside>
|
||||
<DocsNav items={docsNav} location={location} />
|
||||
</aside>
|
||||
);
|
||||
}
|
||||
|
||||
export default function DocsTemplate({
|
||||
title,
|
||||
filename,
|
||||
body,
|
||||
html,
|
||||
showWidgets,
|
||||
widgets,
|
||||
showSidebar,
|
||||
docsNav,
|
||||
location,
|
||||
group,
|
||||
}) {
|
||||
return (
|
||||
<Container size="md">
|
||||
<SidebarLayout sidebar={showSidebar && <DocsSidebar docsNav={docsNav} location={location} />}>
|
||||
<article data-docs-content>
|
||||
{filename && <EditLink collection={`docs_${group}`} filename={filename} />}
|
||||
<h1>{title}</h1>
|
||||
<Markdown body={body} html={html} />
|
||||
{showWidgets && <Widgets widgets={widgets} location={location} />}
|
||||
</article>
|
||||
</SidebarLayout>
|
||||
</Container>
|
||||
);
|
||||
}
|
@ -28,7 +28,7 @@ const Text = styled.p`
|
||||
function FeatureItem({ feature, description, imgpath, kind }) {
|
||||
return (
|
||||
<Box>
|
||||
{imgpath && <img src={require(`../img/${imgpath}`)} alt="" />}
|
||||
{imgpath && <img src={require(`../img/${imgpath}`).default} alt="" />}
|
||||
<Title kind={kind}>
|
||||
<Markdownify source={feature} />
|
||||
</Title>
|
||||
|
Reference in New Issue
Block a user