diff --git a/src/pages/blog.js b/src/pages/blog.js index 433df0b..340046b 100644 --- a/src/pages/blog.js +++ b/src/pages/blog.js @@ -1,12 +1,13 @@ import * as React from "react" -import "../index.css" - -import Layout from "../components/layout" -import Seo from "../components/seo" +import * as styles from "./blog.module.css" import { graphql, Link } from "gatsby" import { GatsbyImage } from "gatsby-plugin-image" +import Layout from "../components/layout" +import Seo from "../components/seo" +import Back from "../components/items/back" + export const query = graphql` query { allSanityPost { @@ -23,10 +24,15 @@ export const query = graphql` name image { asset { - gatsbyImageData + gatsbyImageData(width: 40, height: 40) } } } + mainImage { + asset { + gatsbyImageData(aspectRatio: 1.618) + } + } } } } @@ -34,21 +40,38 @@ export const query = graphql` ` const BlogPage = ({ data }) => ( - -
- {data.allSanityPost.edges.map(post => ( -
-

{post.node._createdAt}

- -

{post.node.title}

+ +
+
+ +
+
+ {data.allSanityPost.edges.map(post => ( + +
+ +
+

{post.node.title}

+

{post.node._createdAt}

+
+ +

{post.node.author.name}

+
+

{post.node.excerpt}

+
+
-
- -

{post.node.author.name}

-
-

{post.node.excerpt}

-
- ))} + ))} +
) diff --git a/src/pages/blog.module.css b/src/pages/blog.module.css new file mode 100644 index 0000000..cb785c5 --- /dev/null +++ b/src/pages/blog.module.css @@ -0,0 +1,66 @@ +.container { + display: grid; + gap: 2rem; + padding: 1.25rem; +} +.back { + justify-self: start; +} +.articleContainer { + display: grid; + grid-template-columns: auto; + place-items: center; + align-items: stretch; + gap: 3rem; +} +.card { + display: grid; + max-width: 50ch; + box-shadow: 0 6px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.2); +} +.headerImage { + max-height: 50vh; +} + +.cardContent { + background-color: var(--secondary-background-color); + padding: 2rem; +} +.published { + font-weight: 100; +} +.header { + font-size: 2.25rem; +} + +.author { + display: grid; + grid-template-columns: auto 1fr; + align-items: center; + gap: 0.5em; + font-weight: 100; + margin-block: 1rem; +} +.authorImage { + border: 2px solid white; +} + +.link { + color: white; +} +.link h2 { + text-decoration: underline; + text-decoration-color: var(--link-color); +} +.link:hover h2 { + text-decoration-color: var(--link-color-hover); +} + +@media (min-width: 60em) { + .container { + padding: 2rem; + } + .articleContainer { + grid-template-columns: auto auto; + } +}