diff --git a/website/.flowconfig b/website/.flowconfig new file mode 100644 index 00000000..1fed4453 --- /dev/null +++ b/website/.flowconfig @@ -0,0 +1,11 @@ +[ignore] + +[include] + +[libs] + +[lints] + +[options] + +[strict] diff --git a/website/contents/getting-started/litho.md b/website/contents/getting-started/litho.md new file mode 100644 index 00000000..0a972968 --- /dev/null +++ b/website/contents/getting-started/litho.md @@ -0,0 +1,24 @@ +--- +path: "getting-started/litho" +title: "Litho" +hasPlayground: false +--- + +## Litho + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nec +sodales libero, sit amet tempus diam. Vivamus finibus vestibulum +est. Vestibulum feugiat pellentesque diam vel hendrerit. Nunc +pretium sollicitudin magna sed pharetra. + +Duis bibendum dapibus quam ac rutrum. Suspendisse potenti. Aliquam +est sapien, gravida ac turpis iaculis, convallis rutrum justo. Sed +est augue, pellentesque eleifend mauris non, ultrices aliquam purus. +Duis sed lorem a lectus feugiat fringilla eu non elit. + +```c +enum { + Test + Test2 +} +``` diff --git a/website/docs/flexDirection.md b/website/contents/properties/flexDirection.md similarity index 89% rename from website/docs/flexDirection.md rename to website/contents/properties/flexDirection.md index 3520967d..51e11a67 100644 --- a/website/docs/flexDirection.md +++ b/website/contents/properties/flexDirection.md @@ -2,6 +2,7 @@ path: "docs/flexDirection" title: "Flex Direction" hasPlayground: true +editableProperties: ['flexDirection'] --- ## Flex Direction @@ -15,3 +16,10 @@ Duis bibendum dapibus quam ac rutrum. Suspendisse potenti. Aliquam est sapien, gravida ac turpis iaculis, convallis rutrum justo. Sed est augue, pellentesque eleifend mauris non, ultrices aliquam purus. Duis sed lorem a lectus feugiat fringilla eu non elit. + +```c +enum { + Test + Test2 +} +``` diff --git a/website/gatsby-config.js b/website/gatsby-config.js index d403e36a..5f5d2992 100644 --- a/website/gatsby-config.js +++ b/website/gatsby-config.js @@ -12,10 +12,12 @@ module.exports = { siteMetadata: { - title: 'Gatsby Default Starter', + title: 'Yoga Layout', }, plugins: [ + // using latest react version 'gatsby-plugin-react-next', + // setting head data like title from within components 'gatsby-plugin-react-helmet', { resolve: `gatsby-plugin-less`, @@ -25,19 +27,35 @@ module.exports = { }, }, }, + // plugin for importing antd components { resolve: 'gatsby-plugin-antd', options: { style: true, }, }, + // reading files from the file-system (used for markdown files) { resolve: `gatsby-source-filesystem`, options: { - path: `${__dirname}/docs`, + path: `${__dirname}/contents`, name: 'markdown-pages', }, }, - 'gatsby-transformer-remark', + // parse markdown files, used for content files + { + resolve: `gatsby-transformer-remark`, + options: { + // code-highlighting in markdown files + plugins: [ + { + resolve: `gatsby-remark-prismjs`, + options: { + classPrefix: 'language-', + }, + }, + ], + }, + }, ], }; diff --git a/website/gatsby-node.js b/website/gatsby-node.js index 20c54a85..28d5fc66 100644 --- a/website/gatsby-node.js +++ b/website/gatsby-node.js @@ -25,6 +25,7 @@ exports.createPages = ({boundActionCreators, graphql}) => { frontmatter { path hasPlayground + editableProperties } html } diff --git a/website/package.json b/website/package.json index b0b63cb5..052cada2 100644 --- a/website/package.json +++ b/website/package.json @@ -11,6 +11,7 @@ "gatsby-plugin-less": "^1.1.4", "gatsby-plugin-react-helmet": "^2.0.3", "gatsby-plugin-react-next": "^1.0.8", + "gatsby-remark-prismjs": "^1.2.14", "gatsby-source-filesystem": "^1.5.18", "gatsby-transformer-remark": "^1.7.31", "immutable": "^4.0.0-rc.9", @@ -25,9 +26,7 @@ "main": "n/a", "scripts": { "build": "gatsby build", - "develop": "gatsby develop", - "format": "prettier --trailing-comma es5 --no-semi --single-quote --write \"src/**/*.js\"", - "test": "echo \"Error: no test specified\" && exit 1" + "develop": "gatsby develop" }, "devDependencies": { "prettier": "^1.10.2" diff --git a/website/src/components/DocsSidebar.css b/website/src/components/DocsSidebar.css index 451752ee..d8d1ff37 100644 --- a/website/src/components/DocsSidebar.css +++ b/website/src/components/DocsSidebar.css @@ -1,4 +1,15 @@ .DocsSidebar { + height: 100%; width: 350px; padding: 20px; + border-right: 1px solid #dddfe2; +} + +.DocsSidebar h3 { + margin-bottom: 0; +} + +.DocsSidebar h4 { + margin-top: 10px; + margin-bottom: 5px; } diff --git a/website/src/components/Page.css b/website/src/components/Page.css index ec1b3bfc..70c80ebe 100644 --- a/website/src/components/Page.css +++ b/website/src/components/Page.css @@ -14,6 +14,13 @@ h2 { font-weight: 500; } +.gatsby-highlight pre[class*="language-"] { + background: none; + padding: 0; + font-size: 14px; + margin-bottom: 15px; +} + .Page { display: flex; flex-direction: column; @@ -25,3 +32,7 @@ h2 { flex-direction: column; flex-grow: 1; } + +.PageContent.withSpacing { + padding-top: 35px; +} diff --git a/website/src/components/Page.js b/website/src/components/Page.js index 5a1680ea..0b010288 100644 --- a/website/src/components/Page.js +++ b/website/src/components/Page.js @@ -14,11 +14,13 @@ import React from 'react'; import Toolbar from './Toolbar'; import Footer from './Footer'; import './Page.css'; +require('prismjs/themes/prism.css'); type Props = {| children: any, title?: string, className?: string, + withSpacing?: boolean, |}; export default (props: Props) => ( @@ -32,7 +34,9 @@ export default (props: Props) => ( Yoga Layout{props.title ? ` | ${props.title}` : ''} */} -
{props.children}
+
+ {props.children} +