Skip to content

Commit

Permalink
Add markdown for featured and projects
Browse files Browse the repository at this point in the history
  • Loading branch information
bchiang7 committed Aug 18, 2018
1 parent 81284ea commit da71fa0
Show file tree
Hide file tree
Showing 13 changed files with 200 additions and 116 deletions.
7 changes: 7 additions & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ module.exports = {
plugins: [
`gatsby-plugin-react-helmet`,
`gatsby-plugin-styled-components`,
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'featured',
path: `${__dirname}/src/content/featured`,
},
},
{
resolve: 'gatsby-source-filesystem',
options: {
Expand Down
6 changes: 0 additions & 6 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,3 @@
*
* See: https://www.gatsbyjs.org/docs/node-apis/
*/

// exports.onCreateNode = ({ node, boundActionCreators }) => {
// const { createNode, createNodeField } = boundActionCreators;
// // Transform the new node here and create a new node or
// // create a new node field.
// };
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"develop": "gatsby develop",
"format": "prettier --write 'src/**/*.js'",
"test": "echo \"Error: no test specified\" && exit 1",
"start": "gatsby develop",
"start": "gatsby develop -o",
"precommit": "pretty-quick --staged && lint-staged"
},
"lint-staged": {
Expand Down
87 changes: 48 additions & 39 deletions src/components/featured.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';

import { IconGithub, IconExternal } from './icons';

Expand Down Expand Up @@ -100,7 +101,6 @@ const Links = styled.div`
`;
const Project = styled.div`
${mixins.flexBetween};
align-items: flex-start;
margin-bottom: 100px;
text-align: right;
Expand Down Expand Up @@ -151,42 +151,51 @@ const data = [
},
];

const Featured = () => (
<FeaturedContainer>
<H3>Some Things I've Built</H3>

<div className="featured__things">
{data &&
data.map(project => (
<Project key={project.id}>
<ImgContainer>
<ProjectImg
src="https://www.budapest.com/w/respsliders/bpcompromo02_1_2_1_2.jpg"
alt=""
/>
</ImgContainer>
<ProjectContent>
<FeaturedLabel>Featured Project</FeaturedLabel>
<ProjectName>{project.name}</ProjectName>
<ProjectDescription>{project.description}</ProjectDescription>
<TechList>
{project.tech.map((tech, i) => (
<li key={i}>{tech}</li>
))}
</TechList>
<Links>
<A href={project.github} target="_blank" rel="noopener">
<IconGithub />
</A>
<A href={project.external} target="_blank" rel="noopener">
<IconExternal />
</A>
</Links>
</ProjectContent>
</Project>
))}
</div>
</FeaturedContainer>
);
class Featured extends Component {
static propTypes = {
featured: PropTypes.array.isRequired,
};

render() {
const { featured } = this.props;
return (
<FeaturedContainer>
<H3>Some Things I've Built</H3>

<div className="featured__things">
{featured &&
featured.map((project, i) => (
<Project key={i}>
<ImgContainer>
<ProjectImg
src="https://www.budapest.com/w/respsliders/bpcompromo02_1_2_1_2.jpg"
alt=""
/>
</ImgContainer>
<ProjectContent>
<FeaturedLabel>Featured Project</FeaturedLabel>
<ProjectName>{project.node.frontmatter.title}</ProjectName>
<ProjectDescription dangerouslySetInnerHTML={{ __html: project.node.html }} />
<TechList>
{project.node.frontmatter.tech.map((tech, i) => (
<li key={i}>{tech}</li>
))}
</TechList>
<Links>
<A href={project.node.frontmatter.github} target="_blank" rel="noopener">
<IconGithub />
</A>
<A href={project.node.frontmatter.external} target="_blank" rel="noopener">
<IconExternal />
</A>
</Links>
</ProjectContent>
</Project>
))}
</div>
</FeaturedContainer>
);
}
}

export default Featured;
100 changes: 42 additions & 58 deletions src/components/projects.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';

import { IconGithub, IconExternal, IconFolder } from './icons';

import styled from 'styled-components';
import { theme, mixins, Section, Ul, A, P } from '../style';
import { theme, mixins, Section, Ul, A } from '../style';

const ProjectsContainer = Section.extend`
${mixins.flexCenter};
Expand Down Expand Up @@ -39,7 +40,7 @@ const ProjectName = styled.h4`
margin: 0 0 10px;
font-size: ${theme.fontSizes.h4};
`;
const ProjectDescription = P.extend`
const ProjectDescription = styled.div`
font-size: ${theme.fontSizes.medium};
`;
const TechList = Ul.extend`
Expand Down Expand Up @@ -69,61 +70,44 @@ const IconLink = A.extend`
}
`;

const data = [
{
id: 1,
name: 'Project One',
github: '#',
external: '#',
tech: ['thing', 'thing', 'thing'],
description: `Gluten-free you probably haven't heard of them jianbing pitchfork pabst. Kombucha occupy iPhone live-edge beard iceland freegan small batch before they sold out DIY marfa chillwave sustainable taiyaki bushwick`,
},
{
id: 2,
name: 'Project Two',
github: '#',
external: '#',
tech: ['thing', 'thing', 'thing'],
description: `Gluten-free you probably haven't heard of them jianbing pitchfork pabst. Kombucha occupy iPhone live-edge beard iceland freegan small batch before they sold out DIY marfa chillwave sustainable taiyaki bushwick`,
},
{
id: 3,
name: 'Project Three',
github: '#',
external: '#',
tech: ['thing', 'thing', 'thing'],
description: `Gluten-free you probably haven't heard of them jianbing pitchfork pabst. Kombucha occupy iPhone live-edge beard iceland freegan small batch before they sold out DIY marfa chillwave sustainable taiyaki bushwick`,
},
];
class Projects extends Component {
static propTypes = {
projects: PropTypes.array.isRequired,
};

const Projects = () => (
<ProjectsContainer>
<ProjectsGrid>
{data &&
data.map(project => (
<Project key={project.id}>
<Folder>
<IconFolder />
</Folder>
<ProjectName>{project.name}</ProjectName>
<ProjectDescription>{project.description}</ProjectDescription>
<TechList>
{project.tech.map((tech, i) => (
<li key={i}>{tech}</li>
))}
</TechList>
<Links>
<IconLink href={project.github} target="_blank" rel="noopener">
<IconGithub />
</IconLink>
<IconLink href={project.external} target="_blank" rel="noopener">
<IconExternal />
</IconLink>
</Links>
</Project>
))}
</ProjectsGrid>
</ProjectsContainer>
);
render() {
const { projects } = this.props;

return (
<ProjectsContainer>
<ProjectsGrid>
{projects &&
projects.map((project, i) => (
<Project key={i}>
<Folder>
<IconFolder />
</Folder>
<ProjectName>{project.node.frontmatter.title}</ProjectName>
<ProjectDescription dangerouslySetInnerHTML={{ __html: project.node.html }} />
<TechList>
{project.node.frontmatter.tech.map((tech, i) => (
<li key={i}>{tech}</li>
))}
</TechList>
<Links>
<IconLink href={project.node.frontmatter.github} target="_blank" rel="noopener">
<IconGithub />
</IconLink>
<IconLink href={project.node.frontmatter.external} target="_blank" rel="noopener">
<IconExternal />
</IconLink>
</Links>
</Project>
))}
</ProjectsGrid>
</ProjectsContainer>
);
}
}

export default Projects;
13 changes: 13 additions & 0 deletions src/content/featured/projectOne/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
date: '2017-04-01'
title: 'Featured Project One'
image: ''
github: 'asdf'
external: 'asdfg'
tech:
- React
- Webpack
- Firebase
---

Gluten-free you probably haven't heard of them jianbing pitchfork pabst. Kombucha occupy iPhone live-edge beard iceland freegan small batch before they sold out DIY marfa chillwave sustainable taiyaki bushwick
13 changes: 13 additions & 0 deletions src/content/featured/projectThree/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
date: '2017-06-01'
title: 'Featured Project Three'
image: ''
github: 'asdf'
external: 'asdfg'
tech:
- React
- Webpack
- Firebase
---

Gluten-free you probably haven't heard of them jianbing pitchfork pabst. Kombucha occupy iPhone live-edge beard iceland freegan small batch before they sold out DIY marfa chillwave sustainable taiyaki bushwick
13 changes: 13 additions & 0 deletions src/content/featured/projectTwo/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
date: '2017-06-01'
title: 'Featured Project Two'
image: ''
github: 'asdf'
external: 'asdfg'
tech:
- React
- Webpack
- Firebase
---

Gluten-free you probably haven't heard of them jianbing pitchfork pabst. Kombucha occupy iPhone live-edge beard iceland freegan small batch before they sold out DIY marfa chillwave sustainable taiyaki bushwick
8 changes: 6 additions & 2 deletions src/content/projects/projectOne/index.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
---
image: ''
date: '2017-12-01'
date: '2017-04-01'
title: 'Project One'
image: ''
github: 'asdf'
external: 'asdfg'
tech:
- React
- Webpack
- Firebase
---

Gluten-free you probably haven't heard of them jianbing pitchfork pabst. Kombucha occupy iPhone live-edge beard iceland freegan small batch before they sold out DIY marfa chillwave sustainable taiyaki bushwick
13 changes: 13 additions & 0 deletions src/content/projects/projectThree/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
date: '2017-06-01'
title: 'Project Three'
image: ''
github: 'asdf'
external: 'asdfg'
tech:
- React
- Webpack
- Firebase
---

Gluten-free you probably haven't heard of them jianbing pitchfork pabst. Kombucha occupy iPhone live-edge beard iceland freegan small batch before they sold out DIY marfa chillwave sustainable taiyaki bushwick
13 changes: 13 additions & 0 deletions src/content/projects/projectTwo/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
date: '2017-06-01'
title: 'Project Two'
image: ''
github: 'asdf'
external: 'asdfg'
tech:
- React
- Webpack
- Firebase
---

Gluten-free you probably haven't heard of them jianbing pitchfork pabst. Kombucha occupy iPhone live-edge beard iceland freegan small batch before they sold out DIY marfa chillwave sustainable taiyaki bushwick
Loading

0 comments on commit da71fa0

Please sign in to comment.