Skip to content

Commit

Permalink
Merge branch 'master' into GraphQLParser-errors
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews committed Nov 13, 2017
2 parents 63a6a45 + 6cd114f commit 143a815
Show file tree
Hide file tree
Showing 37 changed files with 733 additions and 27 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Websites built with Gatsby:
* [React](https://reactjs.org/) ([source](https://github.com/reactjs/reactjs.org))
* [Sourcegraph](https://about.sourcegraph.com)
* [Simply](https://simply.co.za)
* [The freeCodeCamp Guide](https://guide.freecodecamp.org)
* [FloydHub's Blog](https://blog.floydhub.com)
* [mParticle's Documentation](https://docs.mparticle.com)
* [Segment's Blog](https://segment.com/blog/)
Expand Down Expand Up @@ -69,6 +70,10 @@ Websites built with Gatsby:
* [GRANDstack - GraphQL, React, Apollo, Neo4j Database](http://grandstack.io/)
* [GraphCMS's website](https://graphcms.com)
* [Mannequin.io](https://mannequin.io) ([source](https://github.com/LastCallMedia/Mannequin/tree/master/site))
* [API Platform](https://api-platform.com) ([source](https://github.com/api-platform/website))
* [Bottender Docs](https://bottender.js.org/) ([source](https://github.com/bottenderjs/bottenderjs.github.io))
* [How to GraphQL](https://www.howtographql.com/) ([source](https://github.com/howtographql/howtographql))
* [greglobinski.com](https://greglobinski.com) ([source](https://github.com/greglobinski/greglobinski-com))

## Docs

Expand Down
9 changes: 6 additions & 3 deletions examples/using-react-url-query/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,23 @@ export default class IndexPage extends React.PureComponent {
The example shows how to use{` `}
<a href="https://github.com/pbeshai/react-url-query">
react-url-query
</a>{` `}
</a>
{` `}
for binding url query parameters to props.
</p>
<hr />
<p>
The value of this input is reflected in the URL as the <code>t</code>{` `}
The value of this input is reflected in the URL as the <code>t</code>
{` `}
query parameter (with a max length of 8).
</p>
<div>
<label htmlFor="search-input">String:</label>
<SearchInput id="search-input" style={{ marginLeft: `0.5em` }} />
</div>
<p>
The value of this input is reflected in the URL as the <code>n</code>{` `}
The value of this input is reflected in the URL as the <code>n</code>
{` `}
query parameter.
</p>
<div>
Expand Down
8 changes: 8 additions & 0 deletions examples/using-remark-copy-linked-files/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"env": {
"browser": true
},
"globals": {
"graphql": false
}
}
3 changes: 3 additions & 0 deletions examples/using-remark-copy-linked-files/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
public
.cache
node_modules
5 changes: 5 additions & 0 deletions examples/using-remark-copy-linked-files/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# using-gatsby-remark-copy-linked-files

https://using-gatsby-remark-copy-linked-files.gatsbyjs.org

Stub README description
66 changes: 66 additions & 0 deletions examples/using-remark-copy-linked-files/gatsby-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
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-iframe`,
options: {
wrapperStyle: `margin-bottom: 1.0725rem`,
},
},
`gatsby-remark-prismjs`,
// {
// resolve: `gatsby-remark-images`,
// options: {
// maxWidth: 740,
// },
// },
{
resolve: `gatsby-remark-copy-linked-files`,
options: {
// `ignoreFileExtensions` defaults to [`png`, `jpg`, `jpeg`, `bmp`, `tiff`]
// as we assume you'll use gatsby-remark-images to handle
// images in markdown as it automatically creates responsive
// versions of images.
//
// If you'd like to not use gatsby-remark-images and just copy your
// original images to the public directory, set
// `ignoreFileExtensions` to an empty array.
ignoreFileExtensions: [],
},
},
`gatsby-remark-smartypants`,
],
},
},
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
{
resolve: `gatsby-plugin-google-analytics`,
options: {
//trackingId: `ADD YOUR TRACKING ID HERE`,
},
},
`gatsby-plugin-offline`,
`gatsby-plugin-react-helmet`,
{
resolve: `gatsby-plugin-typography`,
options: {
pathToConfigModule: `src/utils/typography`,
},
},
],
}
44 changes: 44 additions & 0 deletions examples/using-remark-copy-linked-files/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
const _ = require(`lodash`)
const Promise = require(`bluebird`)
const path = require(`path`)

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

return new Promise((resolve, reject) => {
const blogPost = path.resolve(`./src/templates/blog-post.js`)
resolve(
graphql(
`
{
allMarkdownRemark(limit: 1000) {
edges {
node {
frontmatter {
path
}
}
}
}
}
`
).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.frontmatter.path,
component: blogPost,
context: {
path: edge.node.frontmatter.path,
},
})
})
})
)
})
}
47 changes: 47 additions & 0 deletions examples/using-remark-copy-linked-files/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "using-remark-copy-linked-files",
"private": true,
"description": "Gatsby example site on gatsby-remark-copy-linked-files",
"author": "Florian Kissling <[email protected]>",
"dependencies": {
"gatsby": "^1.9.108",
"gatsby-link": "^1.6.24",
"gatsby-plugin-google-analytics": "^1.0.12",
"gatsby-plugin-offline": "^1.0.10",
"gatsby-plugin-react-helmet": "^1.0.8",
"gatsby-plugin-sharp": "^1.6.20",
"gatsby-plugin-typography": "^1.7.10",
"gatsby-remark-copy-linked-files": "^1.5.20",
"gatsby-remark-images": "^1.5.31",
"gatsby-remark-prismjs": "^1.2.9",
"gatsby-remark-responsive-iframe": "^1.4.14",
"gatsby-remark-smartypants": "^1.4.8",
"gatsby-source-filesystem": "^1.5.8",
"gatsby-transformer-remark": "^1.7.20",
"gatsby-transformer-sharp": "^1.6.13",
"hast-util-to-html": "^3.1.0",
"lodash": "^4.15.0",
"react-responsive-grid": "^0.3.3",
"typeface-merriweather": "^0.0.35",
"typeface-montserrat": "^0.0.37",
"typography-theme-wordpress-2016": "^0.15.1"
},
"devDependencies": {
"eslint": "^4.9.0",
"eslint-plugin-react": "^7.4.0",
"gh-pages": "^0.12.0",
"prettier": "^1.8.1"
},
"license": "MIT",
"main": "n/a",
"scripts": {
"dev": "gatsby develop",
"lint": "./node_modules/.bin/eslint --ext .js,.jsx --ignore-pattern public .",
"test": "echo \"Error: no test specified\" && exit 1",
"format": "prettier --trailing-comma es5 --no-semi --single-quote --write 'src/**/*.js'",
"develop": "gatsby develop",
"build": "gatsby build",
"deploy": "gatsby build --prefix-paths && 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"
}
}
41 changes: 41 additions & 0 deletions examples/using-remark-copy-linked-files/src/components/Bio.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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 (
<div
style={{
display: `flex`,
marginBottom: rhythm(2.5),
}}
>
<img
src={profilePic}
alt={`Kyle Mathews`}
style={{
marginRight: rhythm(1 / 2),
marginBottom: 0,
width: rhythm(2),
height: rhythm(2),
}}
/>
<p>
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>
</div>
)
}
}

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.
76 changes: 76 additions & 0 deletions examples/using-remark-copy-linked-files/src/layouts/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import React from "react"
import Link from "gatsby-link"
import { Container } from "react-responsive-grid"

import { rhythm, scale } from "../utils/typography"

require(`prismjs/themes/prism-solarizedlight.css`)

class Template extends React.Component {
render() {
const { location, children } = this.props
let header

let rootPath = `/`
if (typeof __PREFIX_PATHS__ !== `undefined` && __PREFIX_PATHS__) {
rootPath = __PATH_PREFIX__ + `/`
}

if (location.pathname === rootPath) {
header = (
<h1
style={{
...scale(1.5),
marginBottom: rhythm(1.5),
marginTop: 0,
}}
>
<Link
style={{
boxShadow: `none`,
textDecoration: `none`,
color: `inherit`,
}}
to={`/`}
>
Gatsby Starter Blog
</Link>
</h1>
)
} else {
header = (
<h3
style={{
fontFamily: `Montserrat, sans-serif`,
marginTop: 0,
marginBottom: rhythm(-1),
}}
>
<Link
style={{
boxShadow: `none`,
textDecoration: `none`,
color: `inherit`,
}}
to={`/`}
>
Gatsby Starter Blog
</Link>
</h3>
)
}
return (
<Container
style={{
maxWidth: rhythm(24),
padding: `${rhythm(1.5)} ${rhythm(3 / 4)}`,
}}
>
{header}
{children()}
</Container>
)
}
}

export default Template
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading

0 comments on commit 143a815

Please sign in to comment.