From 857f9df72f810ad9502fc1296a48da1804690fe4 Mon Sep 17 00:00:00 2001 From: Michael Deeb Date: Tue, 29 Mar 2016 11:33:41 -0700 Subject: [PATCH 1/2] Adding my site to the readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 303652fb628af..e82eab3c78c3c 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ All templates, css, and content are *hot reloadable*. * [nordnet.se/brand](https://www.nordnet.se/brand/) * [likescoffee.com](http://likescoffee.com/) ([source](https://github.com/pamo/pamo.github.io/tree/development)) * [vii.campjs.com](http://vii.campjs.com/) ([source](https://github.com/campjs/campjs-vii)) +* [michaeljdeeb.com](http://michaeljdeeb.com) ([source](https://github.com/michaeljdeeb/michaeljdeeb-gatsby-blog)) * [Edit this file to add yours!](https://github.com/gatsbyjs/gatsby/blob/master/README.md) ### Why use Gatsby instead of other Static Site Generators From 6dc8bf4e9c247fc26ada2908fc09ad424fba55e9 Mon Sep 17 00:00:00 2001 From: Michael Deeb Date: Tue, 29 Mar 2016 11:34:25 -0700 Subject: [PATCH 2/2] Adding a check to verify path strings in front matter are prepended with a forward slash --- lib/utils/glob-pages.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/utils/glob-pages.js b/lib/utils/glob-pages.js index 5588ab347abcb..8613a00418e7f 100644 --- a/lib/utils/glob-pages.js +++ b/lib/utils/glob-pages.js @@ -6,6 +6,7 @@ import fs from 'fs' import frontMatter from 'front-matter' import htmlFrontMatter from 'html-frontmatter' import objectAssign from 'object-assign' +import invariant from 'invariant' const debug = require('debug')('gatsby:glob') let rewritePath try { @@ -76,6 +77,11 @@ module.exports = (directory, callback) => { if (!(parsed.name.slice(0, 1) === '_')) { if (data.path) { // Path was hardcoded. + const pathInvariantMessage = ` + You're setting path to ${data.path} for ${parsed.dirname}, + but it should be /${data.path} + ` + invariant((data.path.charAt(0) === '/'), pathInvariantMessage) pageData.path = data.path } else if (rewritePath) { pageData.path = rewritePath(parsed, pageData)