Skip to content

Commit

Permalink
Remove blog content from theme
Browse files Browse the repository at this point in the history
  • Loading branch information
Becca Bailey committed Jul 30, 2019
1 parent 9956191 commit b6b9666
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 35 deletions.
2 changes: 1 addition & 1 deletion demo/content/blog/my-first-post/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: My First Blog Post!
date: "2019-07-28"
featuredImage: "./featured.jpeg"
featuredImage: "./featured.jpg"
featured: true
---

Expand Down
File renamed without changes
4 changes: 3 additions & 1 deletion demo/content/blog/my-second-post/index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
title: My Second Blog Post!
date: "2019-07-29"
featuredImage: "./featured.jpeg"
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.

![cat](cat.jpeg)

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.
4 changes: 2 additions & 2 deletions demo/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ module.exports = {
author: `Becca Bailey`,
description:
"Proin at viverra nisi. Praesent vehicula dolor non enim tempor pharetra. Aenean sed fermentum massa. In posuere consequat sapien a volutpat. Vivamus quis egestas augue. Nulla eros leo, interdum vel maximus aliquet, suscipit quis purus. ",
siteUrl: `http://becca.is`,
siteUrl: `http://gatsby-theme-writer.netlify.com`,
social: {
twitter: `beccaliz`,
instagram: `beccamakesthings`,
},
},
plugins: ["gatsby-theme-writer"],
plugins: ["@beccanelson/gatsby-theme-writer"],
}
Binary file removed gatsby-theme-writer/content/assets/avatar.png
Binary file not shown.
Binary file not shown.
10 changes: 0 additions & 10 deletions gatsby-theme-writer/content/blog/my-first-post/index.md

This file was deleted.

Binary file not shown.
12 changes: 0 additions & 12 deletions gatsby-theme-writer/content/blog/my-second-post/index.md

This file was deleted.

12 changes: 6 additions & 6 deletions gatsby-theme-writer/gatsby-config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
module.exports = options => ({
siteMetadata: {
title: "Gatsby Theme Writer",
},
Expand All @@ -7,15 +7,15 @@ module.exports = {
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/content/blog`,
name: `blog`,
path: options.contentPath || `content/blog`,
name: options.contentPath || `content/blog`,
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/content/assets`,
name: `assets`,
path: options.assetsPath || `content/assets`,
name: options.assetsPath || `content/assets`,
},
},
{
Expand Down Expand Up @@ -44,4 +44,4 @@ module.exports = {
`gatsby-plugin-sharp`,
`gatsby-plugin-offline`,
],
}
})
10 changes: 8 additions & 2 deletions gatsby-theme-writer/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
const fs = require("fs")
const mkdirp = require("mkdirp")
const path = require("path")
const { createFilePath } = require("gatsby-source-filesystem")

let basePath

exports.onPreBootstrap = ({ reporter }, options) => {
exports.onPreBootstrap = ({ reporter, store }, options) => {
const { program } = store.getState()

basePath = options.basePath || "/"
const contentPath = options.contentPath || "content/blog"
const assetsPath = options.assetsPath || "content/assets"

const paths = [contentPath, assetsPath]
const paths = [
path.join(program.directory, contentPath),
path.join(program.directory, assetsPath),
]

// each of these paths must exist, or gatsby-source-filesystem will throw an error
paths.forEach(path => {
Expand Down
2 changes: 1 addition & 1 deletion gatsby-theme-writer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "git",
"url": "https://github.com/beccanelson/gatsby-theme-writer.git"
},
"version": "1.0.1",
"version": "1.0.2",
"main": "index.js",
"license": "MIT",
"peerDependencies": {
Expand Down

0 comments on commit b6b9666

Please sign in to comment.