This repository has been archived by the owner on Mar 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
144 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import React from "react" | ||
import styled from "styled-components" | ||
import { Link } from "gatsby" | ||
import Button from "../../components/Button/button" | ||
|
||
const BlogItem = styled.article` | ||
padding: 1rem 0; | ||
display: flex; | ||
flex-direction: column; | ||
@media (min-width: 768px) { | ||
flex-direction: row; | ||
} | ||
` | ||
|
||
const BlogTitle = styled.div` | ||
h2 { | ||
display: inline-block; | ||
position: relative; | ||
line-height: 2.25rem; | ||
font-size: 1.5rem; | ||
} | ||
@media (min-width: 768px) { | ||
box-sizing: border-box; | ||
padding-right: 2rem; | ||
width: 50%; | ||
h2 { | ||
margin: 0; | ||
font-size: 1.75rem; | ||
} | ||
} | ||
` | ||
|
||
const BlogMeta = styled.div` | ||
padding: 1rem 0; | ||
display: flex; | ||
justify-content: space-between; | ||
h4 { | ||
margin: 0; | ||
font-size: 1rem; | ||
line-height: 30px; | ||
color: #939393; | ||
} | ||
` | ||
|
||
const BlogContent = styled.div` | ||
@media (min-width: 768px) { | ||
width: 48%; | ||
display: flex; | ||
flex-direction: column; | ||
p { | ||
margin-top: 0; | ||
} | ||
} | ||
` | ||
|
||
const BlogList = props => { | ||
return ( | ||
<BlogItem key={props.key}> | ||
<BlogTitle> | ||
<h2>{props.title}</h2> | ||
</BlogTitle> | ||
<BlogContent> | ||
<p>{props.excerpt}</p> | ||
<BlogMeta> | ||
<Link className="btn-link" to={props.path}> | ||
<Button /> | ||
</Link> | ||
<h4>{props.date}</h4> | ||
</BlogMeta> | ||
</BlogContent> | ||
</BlogItem> | ||
) | ||
} | ||
|
||
export default BlogList |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import React from "react" | ||
import SEO from "../components/SEO" | ||
import Layout from "../components/layout" | ||
import { graphql } from "gatsby" | ||
import BlogItem from "../components/Blog/blog-item" | ||
|
||
const Journal = ({ data }) => { | ||
return ( | ||
<> | ||
<SEO /> | ||
<Layout> | ||
<h1>Bonneville Journal</h1> | ||
<p> | ||
{" "} | ||
Phasellus vel egestas ipsum. Integer tristique ullamcorper purus a | ||
suscipit. Duis condimentum arcu tortor, vitae faucibus elit eleifend | ||
eu. Curabitur mauris risus, pretium et est at, consequat venenatis | ||
sem. Phasellus vehicula ligula id mauris facilisis bibendum. | ||
</p> | ||
{data.allMarkdownRemark.edges.map(({ node }) => ( | ||
<BlogItem | ||
title={node.frontmatter.title} | ||
excerpt={node.excerpt} | ||
path={node.frontmatter.path} | ||
date={node.frontmatter.date} | ||
/> | ||
))} | ||
</Layout> | ||
</> | ||
) | ||
} | ||
|
||
export default Journal | ||
|
||
export const query = graphql` | ||
query { | ||
allMarkdownRemark( | ||
sort: { fields: [frontmatter___date], order: DESC } | ||
limit: 3 | ||
) { | ||
totalCount | ||
edges { | ||
node { | ||
id | ||
frontmatter { | ||
title | ||
date(formatString: "MMMM DD, YY") | ||
path | ||
} | ||
excerpt | ||
} | ||
} | ||
} | ||
} | ||
` |