New site setup

This commit is contained in:
Tim Schaub
2018-04-15 11:27:55 -06:00
parent affc59e2c5
commit d33026d12c
22 changed files with 16175 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
import React from 'react';
import injectSheet from 'react-jss';
import {object, func} from 'prop-types';
import Link from 'gatsby-link';
const Layout = ({classes, children}) => (
<div className={classes.layout}>
<header className={classes.header}>
<h1>
<Link to="/">OpenLayers</Link>
</h1>
<div>
<Link to="/examples/">examples</Link>
</div>
</header>
<main className={classes.main}>{children()}</main>
</div>
);
Layout.propTypes = {
children: func.isRequired,
classes: object.isRequired
};
const styles = {
layout: {
margin: '1em auto',
maxWidth: '960px'
},
header: {
display: 'flex',
alignItems: 'baseline',
padding: '0 2em',
marginBottom: '2em',
'& h1': {
margin: '0 auto 0 0'
}
},
main: {
padding: '0 2em'
}
};
export default injectSheet(styles)(Layout);
+42
View File
@@ -0,0 +1,42 @@
import React, {Component} from 'react';
import {object} from 'prop-types';
import Link from 'gatsby-link';
class Examples extends Component {
renderExample({node}) {
const context = node.context;
return (
<li key={node.id}>
<Link to={context.slug}>{context.frontmatter.title}</Link>
</li>
);
}
render() {
return <ul>{this.props.data.allSitePage.edges.map(this.renderExample)}</ul>;
}
}
Examples.propTypes = {
data: object.isRequired
};
export const query = graphql`
query ExampleList {
allSitePage(filter: {pluginCreator: {name: {eq: "examples"}}}) {
edges {
node {
id
context {
slug
frontmatter {
title
}
}
}
}
}
}
`;
export default Examples;
+3
View File
@@ -0,0 +1,3 @@
import React from 'react';
export default () => <p>This is the home page</p>;
+14
View File
@@ -0,0 +1,14 @@
const Typography = require('typography');
const theme = require('typography-theme-noriega').default;
const CodePlugin = require('typography-plugin-code').default;
theme.plugins = [new CodePlugin()];
theme.overrideThemeStyles = () => ({
a: {
color: '#003c88',
textDecoration: 'none'
}
});
module.exports = new Typography(theme);