forked from jlengstorf/gatsby-theme-jam-example
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Becca Bailey
committed
Jul 29, 2019
1 parent
f0f9be4
commit 695ebb5
Showing
22 changed files
with
3,075 additions
and
2,873 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,10 @@ | ||
--- | ||
title: My First Blog Post! | ||
date: "2019-07-28" | ||
featuredImage: "./featured.jpeg" | ||
featured: true | ||
--- | ||
|
||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent varius fringilla quam ultrices tincidunt. Etiam imperdiet massa a libero dignissim efficitur. Suspendisse tempor dictum nisi, sed tincidunt lorem blandit in. Morbi est diam, gravida vitae condimentum id, finibus imperdiet leo. Donec at tortor placerat, ullamcorper leo non, rutrum purus. Aenean varius luctus sapien, in sollicitudin augue blandit vestibulum. Cras elementum orci vel metus venenatis faucibus. Cras tempus cursus eros, vel consequat diam placerat et. Vestibulum ornare laoreet vulputate. In tellus orci, viverra a massa id, tristique fermentum arcu. Ut in velit lacus. | ||
|
||
Mauris commodo nisi mauris, imperdiet finibus tortor viverra non. Sed sit amet purus quis nibh lacinia consequat ac efficitur tellus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Proin egestas malesuada orci non porta. Aliquam erat volutpat. Sed hendrerit semper lacus porta sollicitudin. Nam tristique diam sem, sit amet condimentum tortor lacinia id. Donec ac mauris arcu. Praesent sodales sed nibh vel suscipit. In venenatis pretium gravida. Mauris ante lorem, imperdiet id iaculis nec, auctor sed dui. Aenean sagittis, purus vel aliquet condimentum, quam felis aliquet elit, nec dictum velit justo id nibh. Mauris non ex ac lacus condimentum rhoncus. Etiam hendrerit pretium mi. Morbi accumsan quis orci at viverra. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,10 @@ | ||
--- | ||
title: My Second Blog Post! | ||
date: "2019-07-29" | ||
featuredImage: "./featured.jpeg" | ||
featured: true | ||
--- | ||
|
||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent varius fringilla quam ultrices tincidunt. Etiam imperdiet massa a libero dignissim efficitur. Suspendisse tempor dictum nisi, sed tincidunt lorem blandit in. Morbi est diam, gravida vitae condimentum id, finibus imperdiet leo. Donec at tortor placerat, ullamcorper leo non, rutrum purus. Aenean varius luctus sapien, in sollicitudin augue blandit vestibulum. Cras elementum orci vel metus venenatis faucibus. Cras tempus cursus eros, vel consequat diam placerat et. Vestibulum ornare laoreet vulputate. In tellus orci, viverra a massa id, tristique fermentum arcu. Ut in velit lacus. | ||
|
||
Mauris commodo nisi mauris, imperdiet finibus tortor viverra non. Sed sit amet purus quis nibh lacinia consequat ac efficitur tellus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Proin egestas malesuada orci non porta. Aliquam erat volutpat. Sed hendrerit semper lacus porta sollicitudin. Nam tristique diam sem, sit amet condimentum tortor lacinia id. Donec ac mauris arcu. Praesent sodales sed nibh vel suscipit. In venenatis pretium gravida. Mauris ante lorem, imperdiet id iaculis nec, auctor sed dui. Aenean sagittis, purus vel aliquet condimentum, quam felis aliquet elit, nec dictum velit justo id nibh. Mauris non ex ac lacus condimentum rhoncus. Etiam hendrerit pretium mi. Morbi accumsan quis orci at viverra. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,10 @@ | ||
--- | ||
title: My First Blog Post! | ||
date: "2019-07-28" | ||
featuredImage: "./featured.jpg" | ||
featured: true | ||
--- | ||
|
||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent varius fringilla quam ultrices tincidunt. Etiam imperdiet massa a libero dignissim efficitur. Suspendisse tempor dictum nisi, sed tincidunt lorem blandit in. Morbi est diam, gravida vitae condimentum id, finibus imperdiet leo. Donec at tortor placerat, ullamcorper leo non, rutrum purus. Aenean varius luctus sapien, in sollicitudin augue blandit vestibulum. Cras elementum orci vel metus venenatis faucibus. Cras tempus cursus eros, vel consequat diam placerat et. Vestibulum ornare laoreet vulputate. In tellus orci, viverra a massa id, tristique fermentum arcu. Ut in velit lacus. | ||
|
||
Mauris commodo nisi mauris, imperdiet finibus tortor viverra non. Sed sit amet purus quis nibh lacinia consequat ac efficitur tellus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Proin egestas malesuada orci non porta. Aliquam erat volutpat. Sed hendrerit semper lacus porta sollicitudin. Nam tristique diam sem, sit amet condimentum tortor lacinia id. Donec ac mauris arcu. Praesent sodales sed nibh vel suscipit. In venenatis pretium gravida. Mauris ante lorem, imperdiet id iaculis nec, auctor sed dui. Aenean sagittis, purus vel aliquet condimentum, quam felis aliquet elit, nec dictum velit justo id nibh. Mauris non ex ac lacus condimentum rhoncus. Etiam hendrerit pretium mi. Morbi accumsan quis orci at viverra. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,10 @@ | ||
--- | ||
title: My Second Blog Post! | ||
date: "2019-07-29" | ||
featuredImage: "./featured.jpg" | ||
featured: true | ||
--- | ||
|
||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent varius fringilla quam ultrices tincidunt. Etiam imperdiet massa a libero dignissim efficitur. Suspendisse tempor dictum nisi, sed tincidunt lorem blandit in. Morbi est diam, gravida vitae condimentum id, finibus imperdiet leo. Donec at tortor placerat, ullamcorper leo non, rutrum purus. Aenean varius luctus sapien, in sollicitudin augue blandit vestibulum. Cras elementum orci vel metus venenatis faucibus. Cras tempus cursus eros, vel consequat diam placerat et. Vestibulum ornare laoreet vulputate. In tellus orci, viverra a massa id, tristique fermentum arcu. Ut in velit lacus. | ||
|
||
Mauris commodo nisi mauris, imperdiet finibus tortor viverra non. Sed sit amet purus quis nibh lacinia consequat ac efficitur tellus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Proin egestas malesuada orci non porta. Aliquam erat volutpat. Sed hendrerit semper lacus porta sollicitudin. Nam tristique diam sem, sit amet condimentum tortor lacinia id. Donec ac mauris arcu. Praesent sodales sed nibh vel suscipit. In venenatis pretium gravida. Mauris ante lorem, imperdiet id iaculis nec, auctor sed dui. Aenean sagittis, purus vel aliquet condimentum, quam felis aliquet elit, nec dictum velit justo id nibh. Mauris non ex ac lacus condimentum rhoncus. Etiam hendrerit pretium mi. Morbi accumsan quis orci at viverra. |
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 |
---|---|---|
@@ -1,6 +1,47 @@ | ||
module.exports = { | ||
siteMetadata: { | ||
title: "Gatsby Theme Jam Example Submission", | ||
title: "Gatsby Theme Writer", | ||
}, | ||
plugins: ["gatsby-plugin-theme-ui"], | ||
plugins: [ | ||
"gatsby-plugin-theme-ui", | ||
{ | ||
resolve: `gatsby-source-filesystem`, | ||
options: { | ||
path: `${__dirname}/content/blog`, | ||
name: `blog`, | ||
}, | ||
}, | ||
{ | ||
resolve: `gatsby-source-filesystem`, | ||
options: { | ||
path: `${__dirname}/content/assets`, | ||
name: `assets`, | ||
}, | ||
}, | ||
{ | ||
resolve: `gatsby-transformer-remark`, | ||
options: { | ||
plugins: [ | ||
{ | ||
resolve: `gatsby-remark-images`, | ||
options: { | ||
maxWidth: 590, | ||
}, | ||
}, | ||
{ | ||
resolve: `gatsby-remark-responsive-iframe`, | ||
options: { | ||
wrapperStyle: `margin-bottom: 1.0725rem`, | ||
}, | ||
}, | ||
`gatsby-remark-copy-linked-files`, | ||
`gatsby-remark-smartypants`, | ||
`@weknow/gatsby-remark-twitter`, | ||
], | ||
}, | ||
}, | ||
`gatsby-transformer-sharp`, | ||
`gatsby-plugin-sharp`, | ||
`gatsby-plugin-offline`, | ||
], | ||
} |
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 |
---|---|---|
@@ -1,21 +1,32 @@ | ||
exports.createPages = ({ actions, reporter }) => { | ||
const fs = require("fs") | ||
|
||
exports.onPreBootstrap = ({ reporter }, options) => { | ||
const contentPath = options.contentPath || "content" | ||
const blogPath = `${contentPath}/blog` | ||
const assetsPath = `${contentPath}/assets` | ||
|
||
const paths = [contentPath, blogPath, assetsPath] | ||
|
||
// each of these paths must exist, or gatsby-source-filesystem will throw an error | ||
paths.forEach(path => { | ||
if (!fs.existsSync(path)) { | ||
reporter.info(`Creating the ${path} directory`) | ||
fs.mkdirSync(path) | ||
} | ||
}) | ||
|
||
if (!fs.existsSync(contentPath)) { | ||
reporter.info(`Creating the ${contentPath} directory`) | ||
fs.mkdirSync(contentPath) | ||
} | ||
} | ||
|
||
exports.createPages = ({ actions, reporter }, options) => { | ||
reporter.warn("make sure to load data from somewhere!") | ||
|
||
// TODO replace this with data from somewhere | ||
actions.createPage({ | ||
path: "/", | ||
path: options.basePath || "/", | ||
component: require.resolve("./src/templates/page.js"), | ||
context: { | ||
heading: "Your Theme Here", | ||
content: ` | ||
<p> | ||
Use this handy theme example as the basis for your own amazing theme! | ||
</p> | ||
<p> | ||
For more information, see | ||
<a href="https://themejam.gatsbyjs.org">themejam.gatsbyjs.org</a>. | ||
</p> | ||
`, | ||
}, | ||
}) | ||
} |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,29 @@ | ||
import { Link } from "gatsby" | ||
import Image from "gatsby-image" | ||
import React from "react" | ||
import { Styled } from "theme-ui" | ||
import PostMetadata from "./post-metadata" | ||
/** @jsx jsx */ | ||
import { jsx } from "theme-ui" | ||
|
||
const FeaturedPost = ({ | ||
title, | ||
formattedDate, | ||
descriptionHTML, | ||
slug, | ||
fluidImageData, | ||
timeToRead, | ||
}) => { | ||
return ( | ||
<article> | ||
<Image fluid={fluidImageData} /> | ||
<Styled.h2 sx={{ marginBottom: 0 }}>{title}</Styled.h2> | ||
<PostMetadata timeToRead={timeToRead} formattedDate={formattedDate} /> | ||
<p> | ||
{descriptionHTML} <Link to={slug}>Read more</Link> | ||
</p> | ||
</article> | ||
) | ||
} | ||
|
||
export default FeaturedPost |
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,31 @@ | ||
import FeaturedPost from "./featured-post" | ||
/** @jsx jsx */ | ||
import { jsx } from "theme-ui" | ||
|
||
const FeaturedPosts = ({ posts }) => { | ||
return ( | ||
<div | ||
sx={{ | ||
display: "grid", | ||
gridColumnGap: 3, | ||
gridTemplateColumns: "repeat(2, 1fr)", | ||
padding: 3, | ||
border: "1px solid #eee", | ||
backgroundColor: "#fcfcfc", | ||
borderRadius: 4, | ||
}} | ||
> | ||
{posts.map(post => ( | ||
<FeaturedPost | ||
title={post.frontmatter.title} | ||
formattedDate={post.frontmatter.date} | ||
descriptionHTML={post.excerpt} | ||
fluidImageData={post.frontmatter.featuredImage.childImageSharp.fluid} | ||
timeToRead={post.timeToRead} | ||
/> | ||
))} | ||
</div> | ||
) | ||
} | ||
|
||
export default FeaturedPosts |
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,11 @@ | ||
import React from "react" | ||
|
||
const PostMetadata = ({ timeToRead, formattedDate }) => { | ||
return ( | ||
<small> | ||
{formattedDate} | {`${timeToRead || 0} minute read`} | ||
</small> | ||
) | ||
} | ||
|
||
export default PostMetadata |
11 changes: 10 additions & 1 deletion
11
...-theme-writer/src/components/SiteTitle.js → ...theme-writer/src/components/site-title.js
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
Oops, something went wrong.