chore: update gatsby to v3 (#5057)

This commit is contained in:
Erez Rokah
2021-03-08 01:29:06 -08:00
committed by GitHub
parent 3c8f780ba8
commit 9a21eb38fa
22 changed files with 1509 additions and 2498 deletions

View 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>
);
}

View 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>
);
}

View File

@ -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>