Upgrade gatsbyjs to v2

This commit is contained in:
Niklas von Hertzen 2019-04-05 21:28:45 -07:00
parent 41eb8ab22f
commit 24823d0491
10 changed files with 10688 additions and 6740 deletions

17351
www/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -5,23 +5,29 @@
"private": true, "private": true,
"author": "Niklas von Hertzen", "author": "Niklas von Hertzen",
"dependencies": { "dependencies": {
"cpy-cli": "^1.0.1", "cpy-cli": "^2.0.0",
"gatsby": "^1.9.127", "gatsby": "^2.3.14",
"gatsby-link": "^1.6.30", "gatsby-link": "^2.0.16",
"gatsby-plugin-catch-links": "^1.0.13", "gatsby-plugin-catch-links": "^2.0.13",
"gatsby-plugin-glamor": "^1.6.9", "gatsby-plugin-glamor": "^2.0.9",
"gatsby-plugin-google-analytics": "^1.0.14", "gatsby-plugin-google-analytics": "^2.0.18",
"gatsby-plugin-react-helmet": "^1.0.8", "gatsby-plugin-react-helmet": "^3.0.12",
"gatsby-plugin-twitter": "^1.0.14", "gatsby-plugin-twitter": "^2.0.13",
"gatsby-plugin-typography": "^1.7.10", "gatsby-plugin-typography": "^2.2.10",
"gatsby-remark-prismjs": "^1.2.10", "gatsby-remark-prismjs": "^3.2.7",
"gatsby-source-filesystem": "^1.5.9", "gatsby-source-filesystem": "^2.0.28",
"gatsby-transformer-remark": "^1.7.23", "gatsby-transformer-remark": "^2.3.8",
"gzip-size": "^4.1.0", "glamor": "^2.20.40",
"html2canvas": "^1.0.0-alpha.9", "gzip-size": "^5.0.0",
"html2canvas": "^1.0.0-alpha.12",
"mkdirp": "^0.5.1", "mkdirp": "^0.5.1",
"typography": "^0.16.6", "prismjs": "^1.16.0",
"typography-theme-github": "^0.15.10" "react": "^16.8.6",
"react-dom": "^16.8.6",
"react-helmet": "^5.2.0",
"react-typography": "^0.16.19",
"typography": "^0.16.19",
"typography-theme-github": "^0.16.19"
}, },
"license": "MIT", "license": "MIT",
"main": "n/a", "main": "n/a",

View File

@ -37,6 +37,7 @@ class CanvasContainer extends Component {
> >
<img <img
src={close} src={close}
alt="Close"
css={{position: 'absolute', right: '20px', top: '20px', cursor: 'pointer'}} css={{position: 'absolute', right: '20px', top: '20px', cursor: 'pointer'}}
/> />
</div> </div>
@ -123,6 +124,7 @@ export default class Example extends Component {
flex: 1, flex: 1,
margin: 0 margin: 0
}} }}
alt="Try html2canvas"
/> />
</div> </div>
</div> </div>

View File

@ -1,19 +1,14 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types';
import Helmet from 'react-helmet'; import Helmet from 'react-helmet';
require('prismjs/themes/prism-solarizedlight.css'); import './layout.css';
import './index.css';
import Example from '../components/example'; import Example from '../components/example';
require('prismjs/themes/prism-solarizedlight.css');
const TemplateWrapper = ({children}) => const TemplateWrapper = ({children}) =>
<div> <div>
<Helmet title="html2canvas - Screenshots with JavaScript" /> <Helmet title="html2canvas - Screenshots with JavaScript" />
{children()} {children}
<Example /> <Example />
</div>; </div>;
TemplateWrapper.propTypes = {
children: PropTypes.func
};
export default TemplateWrapper; export default TemplateWrapper;

View File

@ -61,6 +61,7 @@ export default class Navigation extends Component {
<img <img
src={menu} src={menu}
onClick={() => this.setState(s => ({open: !s.open}))} onClick={() => this.setState(s => ({open: !s.open}))}
alt="Menu"
css={{ css={{
width: '50px', width: '50px',
cursor: 'pointer', cursor: 'pointer',
@ -72,7 +73,7 @@ export default class Navigation extends Component {
}} }}
/> />
<Link to="/"> <Link to="/">
<img src={logo} css={{margin: 0}} /> <img src={logo} css={{margin: 0}} alt="html2canvas" />
</Link> </Link>
</div> </div>

View File

@ -1,9 +1,10 @@
import React from 'react'; import React from 'react';
import Layout from '../components/layout';
const NotFoundPage = () => const NotFoundPage = () =>
<div> <Layout>
<h1>NOT FOUND</h1> <h1>NOT FOUND</h1>
<p>You just hit a route that doesn&#39;t exist... the sadness.</p> <p>You just hit a route that doesn&#39;t exist... the sadness.</p>
</div>; </Layout>;
export default NotFoundPage; export default NotFoundPage;

View File

@ -1,6 +1,7 @@
import React from 'react'; import React from 'react';
import Link from 'gatsby-link'; import Link from 'gatsby-link';
import logo from '../images/logo_icon.svg'; import logo from '../images/logo_icon.svg';
import Layout from '../components/layout';
import Footer from '../components/footer'; import Footer from '../components/footer';
import Carbon from '../components/carbon'; import Carbon from '../components/carbon';
@ -23,6 +24,7 @@ const linkStyle = {
export default ({data}) => { export default ({data}) => {
return ( return (
<Layout>
<div <div
css={{ css={{
background: '#558b2f', background: '#558b2f',
@ -48,7 +50,7 @@ export default ({data}) => {
}} }}
> >
<div css={{display: 'flex', alignItems: 'center', justifyContent: 'center'}}> <div css={{display: 'flex', alignItems: 'center', justifyContent: 'center'}}>
<img src={logo} /> <img src={logo} alt="html2canvas" />
<h1>html2canvas</h1> <h1>html2canvas</h1>
</div> </div>
<h4 css={{color: 'rgba(255, 255, 255, 0.6)', fontWeight: 300}}> <h4 css={{color: 'rgba(255, 255, 255, 0.6)', fontWeight: 300}}>
@ -111,7 +113,7 @@ export default ({data}) => {
<div css={{margin: '20px'}}> <div css={{margin: '20px'}}>
<a <a
href="#" href="/documentation"
css={linkStyle} css={linkStyle}
onClick={e => { onClick={e => {
e.preventDefault(); e.preventDefault();
@ -194,6 +196,7 @@ export default ({data}) => {
<h5>Connect</h5> <h5>Connect</h5>
<div css={{height: '35px'}}> <div css={{height: '35px'}}>
<iframe <iframe
title="Github"
src="https://ghbtns.com/github-btn.html?user=niklasvh&repo=html2canvas&type=star&count=true&size=large" src="https://ghbtns.com/github-btn.html?user=niklasvh&repo=html2canvas&type=star&count=true&size=large"
frameBorder="0" frameBorder="0"
scrolling="0" scrolling="0"
@ -217,6 +220,7 @@ export default ({data}) => {
</div> </div>
<Footer /> <Footer />
</div> </div>
</Layout>
); );
}; };

View File

@ -4,6 +4,7 @@ import back from '../images/ic_arrow_back_black_24px.svg';
import next from '../images/ic_arrow_forward_black_24px.svg'; import next from '../images/ic_arrow_forward_black_24px.svg';
import Carbon from '../components/carbon'; import Carbon from '../components/carbon';
import Footer from '../components/footer'; import Footer from '../components/footer';
import Layout from '../components/layout';
import Helmet from 'react-helmet'; import Helmet from 'react-helmet';
import Navigation from '../components/navigation'; import Navigation from '../components/navigation';
@ -11,7 +12,7 @@ export default ({data}) => {
const post = data.markdownRemark; const post = data.markdownRemark;
return ( return (
<div> <Layout>
<Helmet <Helmet
title={`${post.frontmatter.title} - html2canvas`} title={`${post.frontmatter.title} - html2canvas`}
meta={[{name: 'description', content: post.frontmatter.description}]} meta={[{name: 'description', content: post.frontmatter.description}]}
@ -103,7 +104,7 @@ export default ({data}) => {
}} }}
> >
<div css={{height: '24px'}}> <div css={{height: '24px'}}>
<img src={back} /> <img src={back} alt="" />
</div> </div>
<div> <div>
<span <span
@ -162,7 +163,7 @@ export default ({data}) => {
</div> </div>
<div css={{height: '24px'}}> <div css={{height: '24px'}}>
<img src={next} /> <img src={next} alt="" />
</div> </div>
</Link> </Link>
: null} : null}
@ -171,7 +172,7 @@ export default ({data}) => {
: null} : null}
<Footer css={{marginLeft: '300px'}} /> <Footer css={{marginLeft: '300px'}} />
</div> </div>
</div> </Layout>
); );
}; };

View File

@ -1,5 +1,4 @@
import Typography from 'typography'; import Typography from 'typography';
import githubTheme from 'typography-theme-github';
const theme = { const theme = {
googleFonts: [ googleFonts: [