Skip to content

Commit

Permalink
docs(www): real about page
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickhulce committed Apr 21, 2019
1 parent d404c2d commit 3641adf
Show file tree
Hide file tree
Showing 8 changed files with 742 additions and 22 deletions.
9 changes: 9 additions & 0 deletions www/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ module.exports = {
path: `${__dirname}/src/images`,
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `markdown`,
path: `${__dirname}/../lib/markdown`,
include: /\.partial\.md$/,
},
},
'gatsby-transformer-remark',
{
resolve: 'gatsby-plugin-react-svg',
options: {
Expand Down
1 change: 1 addition & 0 deletions www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"gatsby-plugin-react-svg": "^2.1.1",
"gatsby-plugin-sharp": "^2.0.32",
"gatsby-source-filesystem": "^2.0.29",
"gatsby-transformer-remark": "^2.3.8",
"gatsby-transformer-sharp": "^2.1.17",
"lodash": "^4.17.11",
"prop-types": "^15.7.2",
Expand Down
6 changes: 3 additions & 3 deletions www/src/components/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ body {
height: 100%;
margin: 0;
background: #282828;
color: hsl(175, 60%, 45%); /* #2eb9aa */
color: #aaa;
font-family: 'Montserrat', 'Open Sans', 'Arial', sans-serif;
}

Expand All @@ -22,7 +22,7 @@ body {

a,
a:visited {
color: #aaa;
color: hsl(175, 60%, 45%); /* #2eb9aa */
text-decoration: none;
}

Expand All @@ -32,7 +32,6 @@ a.active-link:hover {
}

a.active-link {
color: hsl(175, 60%, 45%);
font-weight: 600;
}

Expand Down Expand Up @@ -171,6 +170,7 @@ a.active-link {
}

.footer {
font-size: 80%;
position: absolute;
bottom: 20px;
left: 0;
Expand Down
2 changes: 1 addition & 1 deletion www/src/components/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const Layout = ({children}) => {
<Sidebar siteTitle={data.site.siteMetadata.title} />
<main className="transparent-container">{children}</main>
<footer className="footer">
© {new Date().getFullYear()}{' '}
Made with 😅 in Texas, © {new Date().getFullYear()}{' '}
<a href="https://twitter.com/patrickhulce" target="_blank" rel="noopener">
@patrickhulce
</a>
Expand Down
2 changes: 1 addition & 1 deletion www/src/components/page-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import PropTypes from 'prop-types'

const PageContent = ({children}) => {
return <div style={{marginTop: 110, marginLeft: 130}}>{children}</div>
return <div style={{margin: '110px auto', maxWidth: 1000}}>{children}</div>
}

PageContent.propTypes = {
Expand Down
7 changes: 7 additions & 0 deletions www/src/components/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ const Sidebar = ({siteTitle}) => {
<ul style={{margin: 0, padding: 0}}>
<NavLink href="/" text="Data" />
<NavLink href="/about" text="About" />
<a
href="https://github.com/patrickhulce/third-party-web"
target="_blank"
rel="noopener"
>
GitHub
</a>
</ul>
</nav>
</aside>
Expand Down
44 changes: 37 additions & 7 deletions www/src/pages/about.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,46 @@
import React from 'react'
import {Link} from 'gatsby'
import {Link, StaticQuery, graphql} from 'gatsby'

import SEO from '../components/seo'
import PageContent from '../components/page-content'

const SecondPage = () => (
<PageContent>
<SEO title="About" />
<h1>About the Project</h1>
<p>Welcome to page 2</p>
<Link to="/">Go back to the homepage</Link>
</PageContent>
<StaticQuery
query={graphql`
query AboutPageQuery {
allMarkdownRemark {
edges {
node {
html
frontmatter {
name
}
}
}
}
}
`}
render={data => {
const partials = data.allMarkdownRemark.edges.reduce((map, edge) => {
map[edge.node.frontmatter.name] = edge.node.html
return map
}, {})

return (
<PageContent>
<SEO title="About" />
<h1>About the Project</h1>
<h2>Goals</h2>
<div dangerouslySetInnerHTML={{__html: partials.goals}} />
<h2>Methodology</h2>
<div dangerouslySetInnerHTML={{__html: partials.methodology}} />
<h2>FAQs</h2>
<div dangerouslySetInnerHTML={{__html: partials.faqs}} />
<Link to="/">Get back to the data</Link>
</PageContent>
)
}}
/>
)

export default SecondPage
Loading

0 comments on commit 3641adf

Please sign in to comment.