Skip to content

Commit

Permalink
Update to the latest version (#1)
Browse files Browse the repository at this point in the history
* fix: re-adding Disqus support

enable Disqus comments in posts by providing a ‘disqusShortname’ in the SiteConfig.js.

Resolved haysclark#9

* chore(release): 1.0.4

* fix: adding basic validation for authors

Adding build time error to warn users if ‘authors’ folder is missing and improving posts and authors content documentation.
Resolves haysclark#10

* fix: fixing sample-post dates and folder names

Posts now to have YEAR-MONTH-DAY formatting, allowing GraphQL to sort them correctly.  Post folder names corrected to match the date in each .md file.

* perf: removing dead GraphQL query

* chore(release): 1.0.5

* fix: improving npm ‘clean’ script to wipe .cache

Sometime Gatsby does not clear the .cache folder which can lead to confusion. Running ‘npm clean’, will now delete both public and .cache to aid in resolving this issue.

* fix: fixing MainNav rendering

Adding missing ‘overlay’ and ‘clearfix’ CSS classes to MainNav to resolve render issue when no Cover image is provided.
Updating Big-Sample-Post to have no cover for validation

Resolves haysclark#18

* chore(release): 1.0.6

* fix: adding yarn.lock to fix install issues

Users installing the project with Yarn were missing a critical child dependancies for prismjs@1.9.0.

Resolves haysclark#21

* chore(release): 1.0.7

* chore: updating README with more specific install steps

* added import for prismjs css file to fix missing syntax highlighting

* fix: Adding local image for post cover example

Resolves haysclark#17

* chore: updating package-lock.json

* fix: ignoring linting error

- due to Prisma being added for Gatsby 2.0 support, we are ignoring this minor issue

* chore(release): 1.0.8

* BREAKING CHANGE: installed latest gatsby version [2.0.20]

* chore: updating yarn.lock

* refactor: installing retaled package updates

* refactor: missing 'prismjs' package needed for 'gatsby-transformer-remark' in v2

* refactor: change .babelrc to gatsby default

* refactor: moved layouts to components updated relative imports

* refactor: renamed index.jsx to layout.jsx and moved to components folder

* refactor: wrapped template pages without layout component

* refactor: changed 'children()' to 'children' in layout.jsx

* refactor: pass location to Layout component in all templates

* refactor: renamed id property of authors to uid | id seems to be a special proberty of nodes and messing with it breaks queries

* refactor: deprecated gatsby-link | removed package and updated imports

* refactor: explicit import of graphql tag

* refactor: Rename boundActionCreators to actions

* refactor: Rename pathContext to pageContext

* refactor: Change modifyWebpackConfig to onCreateWebpackConfig

* docs: Updating to reflect Gatsby 2.0 support

* chore: linting JS and most component CSS errors

- avoiding changes to layout.css for now

* chore(release): 2.0.0
  • Loading branch information
soul-wish committed Feb 8, 2019
1 parent 9661104 commit fc70b2f
Show file tree
Hide file tree
Showing 75 changed files with 31,494 additions and 14,079 deletions.
42 changes: 40 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
{
"plugins": ["lodash"]
}
presets: [
[
"@babel/preset-env",
{
loose: true,
modules: false,
useBuiltIns: "usage",
shippedProposals: true,
targets: {
browsers: [">0.25%", "not dead"],
},
},
],
[
"@babel/preset-react",
{
useBuiltIns: true,
pragma: "React.createElement",
},
],
],
plugins: [
[
"@babel/plugin-proposal-class-properties",
{
loose: true,
},
],
"@babel/plugin-syntax-dynamic-import",
"babel-plugin-macros",
[
"@babel/plugin-transform-runtime",
{
helpers: true,
regenerator: true,
},
],
],
}

70 changes: 69 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,74 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

<a name="2.0.0"></a>
# [2.0.0](https://github.com/haysclark/gatsby-starter-casper/compare/v1.0.8...v2.0.0) (2019-01-07)


### Features

* Migrating to Gatsby v2.0 ([e4c50e9](https://github.com/haysclark/gatsby-starter-casper/commit/e4c50e9))



<a name="1.0.8"></a>
## [1.0.8](https://github.com/haysclark/gatsby-starter-casper/compare/v1.0.7...v1.0.8) (2019-01-07)


### Bug Fixes

* Adding local image for post cover example ([49ddc01](https://github.com/haysclark/gatsby-starter-casper/commit/49ddc01)), closes [#17](https://github.com/haysclark/gatsby-starter-casper/issues/17)
* ignoring linting error ([b41908f](https://github.com/haysclark/gatsby-starter-casper/commit/b41908f))



<a name="1.0.7"></a>
## [1.0.7](https://github.com/haysclark/gatsby-starter-casper/compare/v1.0.6...v1.0.7) (2018-05-01)


### Bug Fixes

* adding yarn.lock to fix install issues ([f043bbc](https://github.com/haysclark/gatsby-starter-casper/commit/f043bbc)), closes [#21](https://github.com/haysclark/gatsby-starter-casper/issues/21)



<a name="1.0.6"></a>
## [1.0.6](https://github.com/haysclark/gatsby-starter-casper/compare/v1.0.5...v1.0.6) (2018-04-25)


### Bug Fixes

* fixing MainNav rendering ([d245dc1](https://github.com/haysclark/gatsby-starter-casper/commit/d245dc1)), closes [#18](https://github.com/haysclark/gatsby-starter-casper/issues/18)
* improving npm ‘clean’ script to wipe .cache ([a02fd73](https://github.com/haysclark/gatsby-starter-casper/commit/a02fd73))



<a name="1.0.5"></a>
## [1.0.5](https://github.com/haysclark/gatsby-starter-casper/compare/v1.0.4...v1.0.5) (2018-03-07)


### Bug Fixes

* adding basic validation for authors ([ff26e67](https://github.com/haysclark/gatsby-starter-casper/commit/ff26e67)), closes [#10](https://github.com/haysclark/gatsby-starter-casper/issues/10)
* fixing sample-post dates and folder names ([2c46366](https://github.com/haysclark/gatsby-starter-casper/commit/2c46366))


### Performance Improvements

* removing dead GraphQL query ([b9d4133](https://github.com/haysclark/gatsby-starter-casper/commit/b9d4133))



<a name="1.0.4"></a>
## [1.0.4](https://github.com/haysclark/gatsby-starter-casper/compare/v1.0.3...v1.0.4) (2018-03-07)


### Bug Fixes

* re-adding Disqus support ([9e7a701](https://github.com/haysclark/gatsby-starter-casper/commit/9e7a701)), closes [#9](https://github.com/haysclark/gatsby-starter-casper/issues/9)



<a name="1.0.3"></a>
## [1.0.3](https://github.com/haysclark/gatsby-starter-casper/compare/v1.0.2...v1.0.3) (2018-01-10)

Expand Down Expand Up @@ -38,4 +106,4 @@ All notable changes to this project will be documented in this file. See [standa
<a name="1.0.0"></a>
# 1.0.0 (2018-01-05)

Initial release, see project [README](https://github.com/haysclark/gatsby-starter-casper) for a list of all the features.
Initial release, see project [README](https://github.com/haysclark/gatsby-starter-casper) for a list of all the features.
33 changes: 22 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@ This starter also serves as example for the [Gatsby-Pagination](https://github.c

![Screenshot](docs/screenshot.png)

## GatsbyJS V1
## GatsbyJS V2
This starter currently supports GatsbyJS version 2, which brings progressive web app features such as automatic code and data splitting (by route), prefetching, with service worker/offline-first support and PRPL pattern.

This starter is based on GatsbyJS V1, which brings progressive web app features such as automatic code and data splitting (by route), prefetching, with service worker/offline-first support and PRPL pattern.
> More information on Gatsby can be found [here](https://www.gatsbyjs.org/).
More information in the [announcement](https://www.gatsbyjs.org/blog/gatsby-first-beta-release/).
### GatsbyJS legacy support
This project uses Semantic Versioning which align with major version of GatsbyJS. Thus, GatsbyJS v1 support can be found in 1.x.x releases of this starter, while GatsbyJS v2 support will be found in 2.x.x releases.

> Special thanks to [hnspn](https://github.com/hnspn) for migration the project to support Gatsby v2. 🤘
## Features

Expand Down Expand Up @@ -53,7 +57,7 @@ More information in the [announcement](https://www.gatsbyjs.org/blog/gatsby-firs
* Google Analytics support
* NPM scripts for GitHub Pages deployment
* Social features (uncomment code to use)
* Twitter tweet button
* Twitter tweet button
* Facebook share/share count
* Google+ share button
* easily to add more!
Expand Down Expand Up @@ -84,18 +88,15 @@ Install this starter (assuming [Gatsby](https://github.com/gatsbyjs/gatsby/) is

```sh
gatsby new YourProjectName https://github.com/haysclark/gatsby-starter-casper
npm install # or yarn install
npm run develop # or gatsby develop
gatsby develop
```

Or you can fork the project, make your changes there and merge new features when needed.

Alternatively:
Alternatively, you can clone the repo or a fork of the repo and install it manually.

```sh
git clone https://github.com/haysclark/gatsby-starter-casper YourProjectName # Clone the project
cd YourProjectname
rm -rf .git # So you can have your own changes stored in VCS.
rm -rf .git # Optional, you can leave the .git history for future rebasing
npm install # or yarn install
npm run develop # or gatsby develop
```
Expand Down Expand Up @@ -169,6 +170,16 @@ npm run develop # or gatsby develop

WARNING: Make sure to edit `static/robots.txt` to include your domain for the sitemap!

## Content

### Posts

Posts are authored using Markdown and include some optional YAML frontmatter data properties. Each post should have a separate folder for the .md file in addition to any images or other media related to that post. Posts are stored in a subfolder in the ```/content/``` directory; the target subfolder is set by the _blogPostDir_ property in _SiteConfig.js_.

### Authors

Each post can reference the author of the post, if the author is not set the default author will be used; which is controlled by the _blogAuthorId_ property in _SiteConfig.js_. All authors, including the default author (aka _blodAuthorId_) must have an author JSON file. These JSON files MUST be stored in a folder names ```authors```, for Gatsby to parse them correctly. The location of this ```authors``` folder can be controlled by the _blogAuthorDir_ property in _SiteConfig.js_. It IS possible to have the ```authors``` folder inside the _blogPostDir_ folder.

## Contributing

👍🎉 First off, thanks for taking the time to contribute! 🎉👍
Expand All @@ -177,4 +188,4 @@ The project uses [Conventional Commits](https://conventionalcommits.org/) which

## License

MIT
MIT
2 changes: 1 addition & 1 deletion content/sample-authors/authors/casper.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "casper",
"uid": "casper",
"name": "Casper User",
"image": "https://api.adorable.io/avatars/150/test.png",
"url": "http://gatsbyjs.org/",
Expand Down
2 changes: 1 addition & 1 deletion content/sample-authors/authors/guinevere.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "guinevere",
"uid": "guinevere",
"name": "Guinevere Kuiper",
"image": "https://randomuser.me/api/portraits/women/17.jpg",
"url": "https://randomuser.me/api/?seed=user1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: "Bold Mage"
cover: "https://unsplash.it/1280/500/?random?BoldMage"
cover: "/images/hidden-beach-between-mountains-in-north-norway-picjumbo-com.jpg"
author: "guinevere"
date: "01/01/2017"
date: "2017-01-01"
category: "tech"
tags:
- programming
Expand Down Expand Up @@ -65,4 +65,4 @@ sunt florem.
Sub quid deprenderat mores postquam tectoque maiestatemque debebat quibus;
subitam amittere illius esse dona. Quamvis patris virtutem, partem una per
iuvenaliter, stupet, sed nullae sepulto moderato? Nec phaedimus aequoris dixit.
Hic bis parenti: e petunt satis.
Hic bis parenti: e petunt satis.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "The Fallen Time"
cover: "https://unsplash.it/1280/900/?random?TheFallenTime"
date: "01/02/2017"
date: "2017-01-02"
category: "another one"
tags:
- test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Angels of Mist"
cover: "https://unsplash.it/1280/900/?random?AngelsofMist"
category: "test3"
date: "01/03/2017"
date: "2017-01-03"
tags:
- cheese
- other
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Random project 4 With Super Long Title Phase One"
cover: "https://unsplash.it/1280/300/?random?SuperLong"
category: "random"
date: "02/03/2017"
date: "2017-02-03"
tags:
- say hi
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "The Fairy's Witches"
cover: "https://unsplash.it/1152/300/?random?FaityWitch"
category: "something"
date: "02/04/2017"
date: "2017-02-04"
---
# Eram mora tuas in inter ferens caterva

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "The Butterfly of the Edge"
cover: "https://unsplash.it/1152/300/?random?TheButterflyoftheEdge"
category: "tech"
date: "03/17/2017"
date: "2017-03-17"
tags:
- programming
- more tags
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Birch in the Roses"
cover: "https://unsplash.it/1152/300/?random?BirchintheRoses"
date: "01/03/2017"
date: "2017-03-23"
category: "tech"
tags:
- tag
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
---
title: "Big Test"
cover: "https://unsplash.it/1280/900/?random?BigTest"
category: "moar"
date: "01/03/2018"
date: "2018-01-03"
slug: "Big-Sample_Test"
tags:
- test
- huge
- no-cover
---

# NOTE: This "post" is based on [Markdown Cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) and is meant to test styling of Markdown generated documents.


This is intended as a quick reference and showcase. For more complete info, see [John Gruber's original spec](http://daringfireball.net/projects/markdown/) and the [Github-flavored Markdown info page](http://github.github.com/github-flavored-markdown/).

This cheatsheet is specifically *Markdown Here's* version of Github-flavored Markdown. This differs slightly in styling and syntax from what Github uses, so what you see below might vary a little from what you get in a *Markdown Here* email, but it should be pretty close.
Expand Down
3 changes: 2 additions & 1 deletion data/SiteConfig.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
blogPostDir: "sample-posts", // The name of directory that contains your posts.
blogAuthorDir: "sample-authors", // The name of directory that contains your authors.
blogAuthorDir: "sample-authors", // The name of directory that contains your 'authors' folder.
blogAuthorId: "casper", // The default and fallback author ID used for blog posts without a defined author.
siteTitle: "Gatsby Casper Starter", // Site title.
siteTitleAlt: "GatsbyJS Casper Theme Starter", // Alternative site title for SEO.
Expand All @@ -18,6 +18,7 @@ module.exports = {
// siteFBAppID: "1825356251115265", // optional, sets the FB Application ID for using app insights
sitePaginationLimit: 10, // The max number of posts per page.
googleAnalyticsID: "UA-111982167-1", // GA tracking ID.
// disqusShortname: "https-vagr9k-github-io-gatsby-advanced-starter", // enables Disqus comments, visually deviates from original Casper theme.
siteSocialUrls: [
"https://github.com/haysclark/gatsby-starter-casper",
"https://twitter.com/gatsbyjs",
Expand Down
2 changes: 1 addition & 1 deletion gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ module.exports = {
feeds: [
{
serialize(ctx) {
const rssMetadata = ctx.query.site.siteMetadata.rssMetadata;
const { rssMetadata } = ctx.query.site.siteMetadata;
return ctx.query.allMarkdownRemark.edges.map(edge => ({
categories: edge.node.frontmatter.tags,
date: edge.node.frontmatter.date,
Expand Down
35 changes: 25 additions & 10 deletions gatsby-node.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
const path = require("path");
const _ = require("lodash");
const fs = require("fs");
const webpackLodashPlugin = require("lodash-webpack-plugin");
const siteConfig = require("./data/SiteConfig");
const {
createPaginationPages,
createLinkedPages
createLinkedPages,
createPaginationPages
} = require("gatsby-pagination");
const siteConfig = require("./data/SiteConfig");

exports.onCreateNode = ({ node, boundActionCreators, getNode }) => {
const { createNodeField } = boundActionCreators;
exports.onCreateNode = ({ node, actions, getNode }) => {
const { createNodeField } = actions;
let slug;
if (node.internal.type === "MarkdownRemark") {
const fileNode = getNode(node.parent);
Expand All @@ -34,15 +35,28 @@ exports.onCreateNode = ({ node, boundActionCreators, getNode }) => {
}
};

exports.createPages = ({ graphql, boundActionCreators }) => {
const { createPage } = boundActionCreators;
exports.createPages = ({ graphql, actions }) => {
const { createPage } = actions;

return new Promise((resolve, reject) => {
const indexPage = path.resolve("src/templates/index.jsx");
const postPage = path.resolve("src/templates/post.jsx");
const tagPage = path.resolve("src/templates/tag.jsx");
const categoryPage = path.resolve("src/templates/category.jsx");
const authorPage = path.resolve("src/templates/author.jsx");

if (
!fs.existsSync(
path.resolve(`content/${siteConfig.blogAuthorDir}/authors/`)
)
) {
reject(
new Error(
"The 'authors' folder is missing within the 'blogAuthorDir' folder."
)
);
}

resolve(
graphql(
`
Expand Down Expand Up @@ -169,9 +183,10 @@ exports.createPages = ({ graphql, boundActionCreators }) => {
);
});
};

exports.modifyWebpackConfig = ({ config, stage }) => {
exports.onCreateWebpackConfig = ({ stage, actions }) => {
if (stage === "build-javascript") {
config.plugin("Lodash", webpackLodashPlugin, null);
actions.setWebpackConfig({
plugins: [webpackLodashPlugin]
});
}
};

0 comments on commit fc70b2f

Please sign in to comment.