Skip to content

Commit

Permalink
gh-pages site via x0
Browse files Browse the repository at this point in the history
  • Loading branch information
nmccready committed Aug 27, 2019
1 parent 1bc1efd commit c3fdc48
Show file tree
Hide file tree
Showing 21 changed files with 5,596 additions and 806 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,7 @@ package-lock.json
.eslint*
.tmp
babel.config.js

docs/website/*.md
docs/api_website
docs/public
3 changes: 0 additions & 3 deletions debug.js

This file was deleted.

2 changes: 2 additions & 0 deletions docs/website/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.md
*.mdx
85 changes: 85 additions & 0 deletions docs/website/_app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import React from 'react';
// import { Link } from 'react-router-dom';
import * as scope from '@compositor/x0/components';
import { Provider as RebassProvider } from 'rebass'; // Flex, Box, Container
// import sortBy from 'lodash.sortby';

import LandingLayout from './_landing';
import theme from './_theme';
import Logo from './_logo';

const { ScopeProvider, SidebarLayout } = scope;

// const navOrder = [
// 'index',
// 'getting-started',
// 'markdown',
// 'react',
// 'MDX',
// 'JSX',
// 'routing',
// 'custom-app',
// 'components',
// 'ScopeProvider',
// 'SidebarLayout',
// 'LivePreview',
// 'LiveEditor',
// 'cli-options',
// 'exporting',
// 'examples',
// ];
const pageNames = {
index: 'Home',
'cli-options': 'CLI Options',
};

const hardRoutes = [
{
key: './api.md',
name: 'Api',
href: 'https://localhost:9090',
path: 'https://localhost:9090',
},
{
key: './coverage.md',
name: 'Coverage',
href: 'https://coveralls.io/github/nmccready/use-global-hook?branch=master',
path: 'https://coveralls.io/github/nmccready/use-global-hook?branch=master',
},
];

const sortRoutes = (routes) =>
routes
.map((route) => {
if (!pageNames[route.name]) return route;
return {
...route,
name: pageNames[route.name],
};
})
.concat(hardRoutes);

const App = (props) => {
const { routes, route } = props;
const { layout } = (route && route.props) || {};

const Layout = layout === 'landing' ? LandingLayout : SidebarLayout;

// ! all routes can be custom sorted again by the doc consumer
// ! they come pre-sorted, see @compositor/x0/src/entry.js
const nav = sortRoutes(routes);

return (
<ScopeProvider scope={scope}>
<RebassProvider theme={theme}>
<Layout {...props} title="use-global-hook" routes={nav} logo={<Logo size={24} />} />
</RebassProvider>
</ScopeProvider>
);
};

App.defaultProps = {
title: 'use-global-hook',
};

export default App;
38 changes: 38 additions & 0 deletions docs/website/_landing.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import React from 'react';
import { Flex, Box, Container, Text, BlockLink, Caps } from 'rebass';
import { Link } from 'react-router-dom';
import Logo from './_logo';

export default ({ children }) => (
<React.Fragment>
<Flex alignItems="center">
<BlockLink href="https://github.com/nmccready">
<Flex px={1} py={2} alignItems="center">
<Logo width={100} height={100} />
<Text style={{ position: 'fixed', left: 105 }} fontWeight="bold">
nmccready
</Text>
</Flex>
</BlockLink>
<Box mx="auto" />
<BlockLink px={3} is={Link} to="/">
<Caps fontWeight="bold">use-global-hook</Caps>
</BlockLink>
<BlockLink px={3} href="https://github.com/nmccready/use-global-hook">
<Caps fontWeight="bold">Github</Caps>
</BlockLink>
</Flex>
{children}
<Container>
<Flex py={4} mt={5} flexWrap="wrap">
<BlockLink my={2} mr={3} href="https://github.com/nmccready">
<Caps fontWeight="bold">Github</Caps>
</BlockLink>
<Box mx="auto" />
<Text my={2} fontSize={0}>
© 2019 Nicholas McCready, Inc. All rights reserved
</Text>
</Flex>
</Container>
</React.Fragment>
);
18 changes: 18 additions & 0 deletions docs/website/_logo-rect.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react';
import Logo from './_logo';

export default ({ size = 1024 }) => (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 12"
width={size}
height={size / 2}
fill="none"
stroke="currentcolor"
>
<rect width={24} height={12} stroke="none" fill="black" />
<g transform="translate(8, 2)">
<Logo size={8} />
</g>
</svg>
);
19 changes: 19 additions & 0 deletions docs/website/_logo.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions docs/website/_theme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { theme } from 'rebass';

export default {
...theme,
radii: [0, 4, 8, 16],
};
2 changes: 2 additions & 0 deletions docs/website/docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.md
*.mdx
78 changes: 78 additions & 0 deletions docs/website/docs/_app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import React from 'react';
// import { Link } from 'react-router-dom';
import * as scope from '@compositor/x0/components';
import { Provider as RebassProvider } from 'rebass'; // Flex, Box, Container
// import sortBy from 'lodash.sortby';

import LandingLayout from './_landing';
import theme from './_theme';

const { ScopeProvider, SidebarLayout } = scope;

// const navOrder = [
// 'index',
// 'getting-started',
// 'markdown',
// 'react',
// 'MDX',
// 'JSX',
// 'routing',
// 'custom-app',
// 'components',
// 'ScopeProvider',
// 'SidebarLayout',
// 'LivePreview',
// 'LiveEditor',
// 'cli-options',
// 'exporting',
// 'examples',
// ];
const pageNames = {
index: 'Home',
'cli-options': 'CLI Options',
};

const hardRoutes = [
// {
// key: './coverage.md',
// name: 'Coverage',
// href: 'https://nmccready.github.io/js-common/coverage/lcov-report/',
// path: 'https://nmccready.github.io/js-common/coverage/lcov-report/',
// },
];

const sortRoutes = (routes) =>
routes
.map((route) => {
if (!pageNames[route.name]) return route;
return {
...route,
name: pageNames[route.name],
};
})
.concat(hardRoutes);

const App = (props) => {
const { routes, route } = props;
const { layout } = (route && route.props) || {};

const Layout = layout === 'landing' ? LandingLayout : SidebarLayout;

// ! all routes can be custom sorted again by the doc consumer
// ! they come pre-sorted, see @compositor/x0/src/entry.js
const nav = sortRoutes(routes);

return (
<ScopeProvider scope={scope}>
<RebassProvider theme={theme}>
<Layout {...props} title="js-common" routes={nav} />
</RebassProvider>
</ScopeProvider>
);
};

App.defaultProps = {
title: 'js-common',
};

export default App;
36 changes: 36 additions & 0 deletions docs/website/docs/_landing.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import React from 'react';
import { Flex, Box, Container, Text, BlockLink, Caps } from 'rebass';
import { Link } from 'react-router-dom';
import Logo from './_logo';

export default ({ children }) => (
<React.Fragment>
<Flex alignItems="center">
<BlockLink href="https://github.com/nmccready">
<Flex px={1} py={2} alignItems="center">
{/* <Logo width={100} height={100} /> */}
<Text fontWeight="bold">nmccready</Text>
</Flex>
</BlockLink>
<Box mx="auto" />
<BlockLink px={3} is={Link} to="/">
<Caps fontWeight="bold">js-common</Caps>
</BlockLink>
<BlockLink px={3} href="https://github.com/nmccready/js-common">
<Caps fontWeight="bold">Github</Caps>
</BlockLink>
</Flex>
{children}
<Container>
<Flex py={4} mt={5} flexWrap="wrap">
<BlockLink my={2} mr={3} href="https://github.com/nmccready">
<Caps fontWeight="bold">Github</Caps>
</BlockLink>
<Box mx="auto" />
<Text my={2} fontSize={0}>
© 2019 Nicholas McCready, Inc. All rights reserved
</Text>
</Flex>
</Container>
</React.Fragment>
);
18 changes: 18 additions & 0 deletions docs/website/docs/_logo-rect.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react';
import Logo from './_logo';

export default ({ size = 1024 }) => (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 12"
width={size}
height={size / 2}
fill="none"
stroke="currentcolor"
>
<rect width={24} height={12} stroke="none" fill="black" />
<g transform="translate(8, 2)">
<Logo size={8} />
</g>
</svg>
);
19 changes: 19 additions & 0 deletions docs/website/docs/_logo.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions docs/website/docs/_theme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { theme } from 'rebass';

export default {
...theme,
radii: [0, 4, 8, 16],
};
Binary file added docs/website/docs/favicon.ico
Binary file not shown.
Loading

0 comments on commit c3fdc48

Please sign in to comment.