Skip to content

Commit

Permalink
Update website to latest ocular-gatsby (#991)
Browse files Browse the repository at this point in the history
<!-- For feature, feature enhancement or bug fix, create an issue first and finish To Do List there -->
<!-- Anything doesn't work as expected is a bug, including code, doc and test -->
# For #756
<!-- For other PRs without open issue -->
#### Background
<!-- For all the PRs -->
#### Change List
-
  • Loading branch information
ibgreen committed Mar 19, 2019
1 parent 26b1c35 commit 75e2bc8
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 151 deletions.
38 changes: 20 additions & 18 deletions website/ocular-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,25 +62,27 @@ module.exports = {
path: 'examples/core/transform-feedback/app',
image: 'images/example-transform-feedback.jpg'
},
// {"title": "GLTF", "path": "examples/gltf"},

{ title: "GLTF", "path": "examples/gltf"},
{ title: "Lesson01", "path": "examples/lessons/01/", image: 'images/lesson-1.png'},
{ title: "Lesson02", "path": "examples/lessons/02/", image: 'images/lesson-2.png'},
{ title: "Lesson03", "path": "examples/lessons/03/", image: 'images/lesson-3.png'},
{ title: "Lesson04", "path": "examples/lessons/04/", image: 'images/lesson-4.png'},
{ title: "Lesson05", "path": "examples/lessons/05/", image: 'images/lesson-5.png'},
{ title: "Lesson06", "path": "examples/lessons/06/", image: 'images/lesson-6.png'},
{ title: "Lesson07", "path": "examples/lessons/07/", image: 'images/lesson-7.png'},
{ title: "Lesson08", "path": "examples/lessons/08/", image: 'images/lesson-8.png'},
{ title: "Lesson09", "path": "examples/lessons/09/", image: 'images/lesson-9.png'},
{ title: "Lesson10", "path": "examples/lessons/10/", image: 'images/lesson-10.png'},
{ title: "Lesson11", "path": "examples/lessons/11/", image: 'images/lesson-11.png'},
{ title: "Lesson12", "path": "examples/lessons/12/", image: 'images/lesson-12.png'},
{ title: "Lesson13", "path": "examples/lessons/13/", image: 'images/lesson-13.png'},
{ title: "Lesson14", "path": "examples/lessons/14/", image: 'images/lesson-14.png'},
{ title: "Lesson15", "path": "examples/lessons/15/", image: 'images/lesson-15.png'},
{ title: "Lesson16", "path": "examples/lessons/16/", image: 'images/lesson-16.png'}
],

{"title": "Lesson01", "path": "examples/lessons/01/", image: 'images/lesson-1.png'},
{ "title": "Lesson02", "path": "examples/lessons/02/", image: 'images/lesson-2.png'},
{ "title": "Lesson03", "path": "examples/lessons/03/", image: 'images/lesson-3.png'},
{ "title": "Lesson04", "path": "examples/lessons/04/", image: 'images/lesson-4.png'},
{ "title": "Lesson05", "path": "examples/lessons/05/", image: 'images/lesson-5.png'},
{ "title": "Lesson06", "path": "examples/lessons/06/", image: 'images/lesson-6.png'},
{ "title": "Lesson07", "path": "examples/lessons/07/", image: 'images/lesson-7.png'},
{ "title": "Lesson08", "path": "examples/lessons/08/", image: 'images/lesson-8.png'},
{ "title": "Lesson09", "path": "examples/lessons/09/", image: 'images/lesson-9.png'},
{ "title": "Lesson10", "path": "examples/lessons/10/", image: 'images/lesson-10.png'},
{ "title": "Lesson11", "path": "examples/lessons/11/", image: 'images/lesson-11.png'},
{ "title": "Lesson12", "path": "examples/lessons/12/", image: 'images/lesson-12.png'},
{ "title": "Lesson13", "path": "examples/lessons/13/", image: 'images/lesson-13.png'},
{ "title": "Lesson14", "path": "examples/lessons/14/", image: 'images/lesson-14.png'},
{ "title": "Lesson15", "path": "examples/lessons/15/", image: 'images/lesson-15.png'},
{ "title": "Lesson16", "path": "examples/lessons/16/", image: 'images/lesson-16.png'}
THEME_OVERRIDES: [
{key: true, value: true}
],

DOCS,
Expand Down
4 changes: 2 additions & 2 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"serve": "gatsby serve"
},
"dependencies": {
"gatsby": "2.0.85",
"ocular-gatsby": "1.0.0-alpha.7",
"gatsby": "2.1.38",
"ocular-gatsby": "1.0.0-alpha.12",
"sharp": "0.21.1"
},
"devDependencies": {}
Expand Down
4 changes: 2 additions & 2 deletions website/src/components/example-list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Cubemap from '../../../examples/core/cubemap/app';
// import CustomPicking from '../../../examples/core/custom-picking/app';
// import DeferredRendering from '../../../examples/core/deferred-rendering/app';
import DOF from '../../../examples/core/dof/app';
// import GLTF from '../../../examples/core/gltf/app';
import GLTF from '../../../examples/core/gltf/app';
import Fragment from '../../../examples/core/fragment/app';
import Mandelbrot from '../../../examples/core/mandelbrot/app';
// import Particles from '../../../examples/core/particles/app';
Expand Down Expand Up @@ -49,7 +49,7 @@ export default {
Transform: {app: Transform, path: 'examples/core/transform/'},
TransformFeedbackDemo: {app: TransformFeedback, path: 'examples/core/transform-feedback/'},

// GLTF: {app: GLTF, path: 'examples/gltf'},
GLTF: {app: GLTF, path: 'examples/core/gltf'},

Lesson01: {app: Lesson01, path: 'examples/lessons/01/'},
Lesson02: {app: Lesson02, path: 'examples/lessons/02/'},
Expand Down
129 changes: 0 additions & 129 deletions website/src/components/layout.jsx

This file was deleted.

106 changes: 106 additions & 0 deletions website/src/components/site-query.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
// This component contains the StaticQuery needed to provide data for the layout components.
// These layout components will then pass some of that information down to the rest of the site
// ie to the table of content, header, etc.

// because this is a StaticQuery it needs to be in the local tree so that its graphQl can be
// run by gatsby. Rather, a file of the same name must have the same query in the local tree.
// During the init process, ocular copies this file over to the local tree.


import React from 'react';
import { StaticQuery, graphql } from 'gatsby';

// All common metadata, table-of-contents etc are queried here and put in React context
const QUERY = graphql`
fragment SiteConfigFragment on Site {
siteMetadata {
config {
PROJECT_NAME
PROJECT_TYPE
PROJECT_DESC
HOME_HEADING
HOME_BULLETS {
text
desc
img
}
EXAMPLES {
title
path
}
THEME_OVERRIDES {
key
value
}
}
}
}
fragment MarkdownNodeFragment on MarkdownRemark {
id
fields {
slug
}
frontmatter {
title
}
}
query ConfigQuery {
site {
...SiteConfigFragment
}
allMarkdown: allMarkdownRemark(limit: 2000) {
edges {
node {
...MarkdownNodeFragment
}
}
}
tableOfContents: docsJson {
chapters {
title
level
chapters {
title
level
entries {
id
childMarkdownRemark {
id
frontmatter {
title
}
fields {
slug
}
}
}
}
entries {
id
childMarkdownRemark {
id
frontmatter {
title
}
fields {
slug
}
}
}
}
}
}
`;

// The Layout instance is shared between pages. It queries common, static data
// and makes it available on React context
export default class SiteQuery extends React.Component {
render() {
const { onComplete } = this.props;
return <StaticQuery query={QUERY} render={onComplete} />;
}
}

0 comments on commit 75e2bc8

Please sign in to comment.