forked from facebook/react
-
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
Brian Vaughn
committed
Jun 30, 2017
1 parent
d377e54
commit e5534d6
Showing
25 changed files
with
4,798 additions
and
196 deletions.
There are no files selected for viewing
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,4 @@ | ||
{ | ||
"presets": ['react', 'es2015', 'stage-1'], | ||
"plugins": ['add-module-exports'] | ||
} |
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,7 @@ | ||
node_modules/ | ||
public | ||
.gatsby-context.js | ||
.DS_Store | ||
.intermediate-representation/ | ||
.cache/ | ||
yarn.lock |
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,39 @@ | ||
# back to language cpp to try to bypass osx node failure | ||
language: cpp | ||
sudo: false | ||
env: | ||
- export NODE_VERSION="0.10" | ||
- export NODE_VERSION="0.12" | ||
- export NODE_VERSION="4" | ||
- export NODE_VERSION="5" | ||
os: | ||
- linux | ||
- osx | ||
# pre-install to bring in the correct version of node via nvm | ||
before_install: | ||
- git submodule update --init --recursive | ||
- git clone https://github.com/creationix/nvm.git ./.nvm | ||
- source ./.nvm/nvm.sh | ||
- nvm install $NODE_VERSION | ||
- nvm use $NODE_VERSION | ||
- npm config set python `which python` | ||
- if [ $TRAVIS_OS_NAME == "linux" ]; then | ||
export CC="gcc-4.8"; | ||
export CXX="g++-4.8"; | ||
export LINK="gcc-4.8"; | ||
export LINKXX="g++-4.8"; | ||
fi | ||
- gcc --version | ||
- g++ --version | ||
# node 4 depends on gcc 4.8 | ||
addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- g++-4.8 | ||
- gcc-4.8 | ||
# script needed to test, because defaults don't work on osx | ||
script: | ||
- npm install | ||
- npm run lint |
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 +1,8 @@ | ||
This is the Gatsby site. | ||
# gatsby-starter-blog | ||
Gatsby starter for creating a blog | ||
|
||
Install this starter (assuming Gatsby is installed) by running from your CLI: | ||
`gatsby new gatsby-blog https://github.com/gatsbyjs/gatsby-starter-blog` | ||
|
||
## Running in development | ||
`gatsby develop` |
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,46 @@ | ||
module.exports = { | ||
siteMetadata: { | ||
title: "Gatsby Starter Blog", | ||
author: "Kyle Mathews", | ||
}, | ||
plugins: [ | ||
{ | ||
resolve: `gatsby-source-filesystem`, | ||
options: { | ||
path: `${__dirname}/src/pages`, | ||
name: "pages", | ||
}, | ||
}, | ||
{ | ||
resolve: `gatsby-transformer-remark`, | ||
options: { | ||
plugins: [ | ||
{ | ||
resolve: `gatsby-remark-responsive-image`, | ||
options: { | ||
maxWidth: 590, | ||
}, | ||
}, | ||
{ | ||
resolve: `gatsby-remark-responsive-iframe`, | ||
options: { | ||
wrapperStyle: `margin-bottom: 1.0725rem`, | ||
}, | ||
}, | ||
"gatsby-remark-prismjs", | ||
"gatsby-remark-copy-linked-files", | ||
"gatsby-remark-smartypants", | ||
], | ||
}, | ||
}, | ||
`gatsby-transformer-sharp`, | ||
`gatsby-plugin-sharp`, | ||
{ | ||
resolve: `gatsby-plugin-google-analytics`, | ||
options: { | ||
//trackingId: `ADD YOUR TRACKING ID HERE`, | ||
}, | ||
}, | ||
`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 |
---|---|---|
@@ -0,0 +1,73 @@ | ||
const _ = require("lodash") | ||
const Promise = require("bluebird") | ||
const path = require("path") | ||
const select = require(`unist-util-select`) | ||
const fs = require(`fs-extra`) | ||
|
||
exports.createPages = ({ graphql, boundActionCreators }) => { | ||
const { createPage } = boundActionCreators | ||
|
||
return new Promise((resolve, reject) => { | ||
const pages = [] | ||
const blogPost = path.resolve("./src/templates/blog-post.js") | ||
resolve( | ||
graphql( | ||
` | ||
{ | ||
allMarkdownRemark(limit: 1000) { | ||
edges { | ||
node { | ||
fields { | ||
slug | ||
} | ||
} | ||
} | ||
} | ||
} | ||
` | ||
).then(result => { | ||
if (result.errors) { | ||
console.log(result.errors) | ||
reject(result.errors) | ||
} | ||
|
||
// Create blog posts pages. | ||
_.each(result.data.allMarkdownRemark.edges, edge => { | ||
createPage({ | ||
path: edge.node.fields.slug, // required | ||
component: blogPost, | ||
context: { | ||
slug: edge.node.fields.slug, | ||
}, | ||
}) | ||
}) | ||
}) | ||
) | ||
}) | ||
} | ||
|
||
// Add custom slug for blog posts to both File and MarkdownRemark nodes. | ||
exports.onCreateNode = ({ node, boundActionCreators, getNode }) => { | ||
const { createNodeField } = boundActionCreators | ||
|
||
switch (node.internal.type) { | ||
case 'File': | ||
const parsedFilePath = path.parse(node.relativePath) | ||
const slug = `/${parsedFilePath.dir}/` | ||
createNodeField({ | ||
node, | ||
fieldName: 'slug', | ||
fieldValue: slug | ||
}) | ||
return | ||
|
||
case 'MarkdownRemark': | ||
const fileNode = getNode(node.parent) | ||
createNodeField({ | ||
node, | ||
fieldName: 'slug', | ||
fieldValue: fileNode.fields.slug, | ||
}) | ||
return | ||
} | ||
} |
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,59 @@ | ||
{ | ||
"name": "gatsby-starter-blog", | ||
"description": "Starter Gatsby Blog", | ||
"version": "1.0.0", | ||
"author": "Kyle Mathews <mathews.kyle@gmail.com>", | ||
"bugs": { | ||
"url": "https://github.com/gatsbyjs/gatsby-starter-blog/issues" | ||
}, | ||
"dependencies": { | ||
"gatsby": "next", | ||
"gatsby-link": "next", | ||
"gatsby-transformer-remark": "next", | ||
"gatsby-transformer-sharp": "next", | ||
"gatsby-plugin-google-analytics": "next", | ||
"gatsby-plugin-manifest": "next", | ||
"gatsby-plugin-offline": "next", | ||
"gatsby-plugin-preact": "next", | ||
"gatsby-plugin-sharp": "next", | ||
"gatsby-source-filesystem": "next", | ||
"gatsby-remark-copy-linked-files": "next", | ||
"gatsby-remark-prismjs": "next", | ||
"gatsby-remark-responsive-iframe": "next", | ||
"gatsby-remark-responsive-image": "next", | ||
"gatsby-remark-smartypants": "next", | ||
"lodash": "^4.15.0", | ||
"moment": "^2.14.1", | ||
"react-helmet": "^4.0.0", | ||
"react-responsive-grid": "^0.3.3", | ||
"react-typography": "^0.15.0", | ||
"safe-access": "^0.1.0", | ||
"typeface-merriweather": "^0.0.25", | ||
"typeface-montserrat": "^0.0.24", | ||
"typography": "^0.15.8", | ||
"typography-theme-wordpress-2016": "^0.15.1", | ||
"underscore.string": "^3.2.3" | ||
}, | ||
"devDependencies": { | ||
"gh-pages": "^0.12.0" | ||
}, | ||
"homepage": "https://github.com/gatsbyjs/gatsby-starter-blog#readme", | ||
"keywords": [ | ||
"gatsby" | ||
], | ||
"license": "MIT", | ||
"main": "n/a", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/gatsbyjs/gatsby-starter-blog.git" | ||
}, | ||
"scripts": { | ||
"dev": "gatsby develop", | ||
"lint": "./node_modules/.bin/eslint --ext .js,.jsx --ignore-pattern public .", | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"develop": "gatsby develop", | ||
"build": "gatsby build", | ||
"deploy": "gatsby build --prefix-links && gh-pages -d public", | ||
"fix-semi": "eslint --quiet --ignore-pattern node_modules --ignore-pattern public --parser babel-eslint --no-eslintrc --rule '{\"semi\": [2, \"never\"], \"no-extra-semi\": [2]}' --fix gatsby-node.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import React from "react" | ||
|
||
// Import typefaces | ||
import "typeface-montserrat" | ||
import "typeface-merriweather" | ||
|
||
import profilePic from "./profile-pic.jpg" | ||
import { rhythm } from "../utils/typography" | ||
|
||
class Bio extends React.Component { | ||
render() { | ||
return ( | ||
<p | ||
style={{ | ||
marginBottom: rhythm(2.5), | ||
}} | ||
> | ||
<img | ||
src={profilePic} | ||
alt={`Kyle Mathews`} | ||
style={{ | ||
float: "left", | ||
marginRight: rhythm(1 / 4), | ||
marginBottom: 0, | ||
width: rhythm(2), | ||
height: rhythm(2), | ||
}} | ||
/> | ||
Written by | ||
{" "} | ||
<strong>Kyle Mathews</strong> | ||
{" "} | ||
who lives and works in San Francisco building useful things. | ||
{" "} | ||
<a href="https://twitter.com/kylemathews"> | ||
You should follow him on Twitter | ||
</a> | ||
</p> | ||
) | ||
} | ||
} | ||
|
||
export default Bio |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.