Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews committed Jan 10, 2018
2 parents bb1ec3f + 882cc99 commit e520863
Show file tree
Hide file tree
Showing 50 changed files with 1,645 additions and 430 deletions.
24 changes: 24 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,30 @@ The usual contributing steps are:
* Commit and push to your fork.
* Create an pull request from your branch.

### Contributing to the documentation.

Gatsby, unsurprisingly, uses Gatsby for it's documentation website.

If you want to add/modify any Gatsby documentation, go to the
[docs folder on Github](https://github.com/gatsbyjs/gatsby/tree/master/docs) and
use the file editor to edit and then preview your changes. Github then allows
you to commit the change and raise a PR right in the UI. This is the _easiest_
way you can contribute to the project!

However, if you want to make more changes to the website, that is, change
layouts, add sections/pages, follow the steps below. You can then spin up your
own instance of the Gatsby website and make/preview your changes before raising
a pull request.

* Clone the repo and navigate to `/www`
* Run `yarn` to install all of the website's dependencies.
* Run `gatsby develop` to preview the website in `http://localhost:8000`
* The Markdown files for the documentation live in `/docs` folder. Make
additions or modifications here.
* Make sure to double check your grammar and capitalise correctly.
* Commit and push to your fork.
* Create an pull request from your branch.

## Development tools

### Redux devtools
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,19 @@ Websites built with Gatsby:
* [NYC Planning Labs (New York City Department of City Planning)](https://planninglabs.nyc)([source](https://github.com/nycplanning/labs-planninglabs-home))
* [The State of European Tech 2017](https://2017.stateofeuropeantech.com)
* [Santa Compañía Creativa](https://santacc.es) ([source](https://github.com/DesarrolloWebSantaCC/santacc-web))
* [Pravdomil](https://pravdomil.com) ([source](https://github.com/pravdomil/pravdomil.com))
* [Fabian Schultz' Portfolio](https://fabianschultz.com)
([source](https://github.com/fabe/site))
* [Caddy smells like trees - Free-folk band official page](https://caddysmellsliketrees.ru)
([source](https://github.com/podabed/caddysmellsliketrees.github.io))
* [BRIIM](https://bri.im/)
* [KNW Photography](https://www.knw.io)
([source](https://github.com/ryanwiemer/knw))
* [NEON](http://neonrated.com)
* [A4 纸网](http://www.a4z.cn)([source](https://github.com/hiooyUI/hiooyui.github.io))
* [manu.ninja](https://manu.ninja/) ([source](https://github.com/Lorti/manu.ninja))
* [Kris Hedstrom's Portfolio](https://k-create.com/) ([source](https://github.com/kristofferh/kristoffer))
* [Chocolate free website](https://chocolate-free.com/) ([source](https://github.com/Khaledgarbaya/chocolate-free-website))

## Docs

Expand Down
1 change: 1 addition & 0 deletions docs/docs/awesome-gatsby.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ A curated list of interesting Gatsby community projects and learning resources.
* [Giraffe Academy series on getting started with Gatsby](https://www.youtube.com/playlist?list=PLLAZ4kZ9dFpMXuwazIt4mWtTuqOHdjRlk)
* [Egghead course — "Build a Blog with React and Markdown using Gatsby"](https://egghead.io/courses/build-a-blog-with-react-and-markdown-using-gatsby)
* [Build a photo site with Gatsby — 6 part tutorial](https://jeremey.blog/gatsby-photo/)
* [Blazing fast website with Gatsby and Contentful series](https://www.youtube.com/watch?v=Ek4o40w1tH4&list=PL8KiuH6vpACV-F7jXribe4YveGBhBeG9A)
10 changes: 8 additions & 2 deletions docs/docs/building-with-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ import React, { Component } from "react";

class AboutPage extends Component {
render() {
const config = this.props.data.site.siteMetadata;
return (
<div className="about-container">
<p>About me.</p>
Expand Down Expand Up @@ -125,6 +124,9 @@ export const pageQuery = graphql`
`src/layouts/index.jsx` (optional) wraps page components. You can use it for
portions of pages that are shared across pages like headers and footers.

You can use the `location` prop to render conditionally based on the page
URL.

Example:

```jsx
Expand All @@ -133,7 +135,11 @@ import Navigation from "../components/Navigation/Navigation.jsx";

export default class Template extends React.Component {
render() {
return <Navigation>{this.props.children()}</Navigation>;
if (this.props.location.pathname !== "/") {
return <Navigation>{this.props.children()}</Navigation>;
} else {
return this.props.children();
}
}
}
```
Expand Down
7 changes: 7 additions & 0 deletions docs/docs/create-source-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,10 @@ But at a high-level, these are the jobs of a source plugin:
Gatsby when you're done sourcing nodes. Otherwise either Gatsby will continue
on before you're done sourcing or hang while waiting for you to indicate
you're finished.

[`gatsby-node-helpers`](https://github.com/angeloashmore/gatsby-node-helpers),
a community-made NPM package, can help when writing source plugins. This
package provides a set of helper functions to generate Node objects with the
required fields. This includes automatically generating fields like node IDs
and the `contentDigest` MD5 hash, keeping your code focused on data gathering,
not boilerplate.
2 changes: 1 addition & 1 deletion docs/docs/creating-and-modifying-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ well as client-only routes (e.g. an app that combines marketing pages and your
app that lives under `/app/*`), you want to add code to your `gatsby-node.js`
like the following:

_Note: There's also a plugin that will set up the creation of client-paths automatically:
_Note: There's also a plugin that will set up the creation of client-paths declaratively:
[gatsby-plugin-create-client-paths](/packages/gatsby-plugin-create-client-paths/)_.

```javascript
Expand Down
35 changes: 35 additions & 0 deletions docs/docs/gatsby-starters.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,20 @@ Community:
* Navigation between posts with a previous/next post button
* Tags and tag navigation

* [gatsby-starter-casper](https://github.com/haysclark/gatsby-starter-casper)
[(demo)](https://haysclark.github.io/gatsby-starter-casper/)

Features:

* Page pagination
* CSS
* Tags
* Google Analytics
* Offline support
* Web App Manifest
* SEO
* [Full list here!](https://github.com/haysclark/gatsby-starter-casper#features)

* [gatsby-advanced-starter](https://github.com/Vagr9K/gatsby-advanced-starter)
[(demo)](https://vagr9k.github.io/gatsby-advanced-starter/)

Expand Down Expand Up @@ -298,3 +312,24 @@ Community:
* Password Change
* Protected Routes with Authorization
* Realtime Database with Users

* [gatsby-starter-ceevee](https://github.com/amandeepmittal/gatsby-starter-ceevee) [(demo)](http://gatsby-starter-ceevee.surge.sh/)

Features:

* Based on the Ceevee site template, design by [Styleshout](https://www.styeshout.com/)
* Single Page Resume/Portfolio site
* Target audience Developers, Designers, etc.
* Used CSS Modules, easy to manipulate
* FontAwsome Library for icons
* Responsive Design, optimized for Mobile devices

- [gatsby-starter-product-guy](https://github.com/amandeepmittal/gatsby-starter-product-guy) [(demo)](http://gatsby-starter-product-guy.surge.sh/)

Features:

* Single Page
* A portfolio Developers and Product launchers alike
* Using [Typography.js](kyleamathews.github.io/typography.js/) easy to switch fonts
* All your Project/Portfolio Data in Markdown, server by GraphQL
* Responsive Design, optimized for Mobile devices
105 changes: 105 additions & 0 deletions docs/docs/glamor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
---
title: Glamor
---

Let's create a page using
[Glamor](https://github.com/threepointone/glamor). It might be useful for you to explore [CSS Modules](/tutorial/part-two/) and [Styled Components](/styled-components/) to see how Glamor compares as a styling method.

Glamor lets you write _real_ CSS inline in your components using the same Object
CSS syntax React supports for the `style` prop. Glamor is a variant on "CSS-in-JS"—which solves many of the problems with traditional CSS.

One of the most important problems they solve is selector name collisions. With traditional CSS, you have to be careful not to overwrite CSS selectors used elsewhere in a site because all CSS selectors live in the same global namespace. This unfortunate restriction can lead to elaborate (and often confusing) selector naming schemes.

With CSS-in-JS, you avoid all that as CSS selectors are scoped automatically to their component. Styles are tightly coupled with their components. This makes it very easy to know how to edit a component's CSS as there's never any confusion about how and where CSS is being used.

First, install the Gatsby plugin for Glamor.

```shell
npm install --save gatsby-plugin-glamor
```

And then add it to your `gatsby-config.js`

```javascript{9}
module.exports = {
plugins: [
{
resolve: `gatsby-plugin-typography`,
options: {
pathToConfigModule: `src/utils/typography.js`,
},
},
`gatsby-plugin-glamor`,
],
}
```

Restart `gatsby develop` again to enable the Glamor plugin.

Now create the Glamor page at `src/pages/about-glamor.js`

```jsx
import React from "react";

import Container from "../components/container";

export default () => (
<Container>
<h1>About Glamor</h1>
<p>Glamor is cool</p>
</Container>
);
```

Let's add the same inline `User` component that you would use for CSS Modules, but this time using Glamor's `css`
prop.

```jsx{5-27,33-40}
import React from "react"
import Container from "../components/container"
const User = props =>
<div
css={{
display: `flex`,
alignItems: `center`,
margin: `0 auto 12px auto`,
"&:last-child": { marginBottom: 0 }
}}
>
<img
src={props.avatar}
css={{ flex: `0 0 96px`, width: 96, height: 96, margin: 0 }}
alt=""
/>
<div css={{ flex: 1, marginLeft: 18, padding: 12 }}>
<h2 css={{ margin: `0 0 12px 0`, padding: 0 }}>
{props.username}
</h2>
<p css={{ margin: 0 }}>
{props.excerpt}
</p>
</div>
</div>
export default () =>
<Container>
<h1>About Glamor</h1>
<p>Glamor is cool</p>
<User
username="Jane Doe"
avatar="https://s3.amazonaws.com/uifaces/faces/twitter/adellecharles/128.jpg"
excerpt="I'm Jane Doe. Lorem ipsum dolor sit amet, consectetur adipisicing elit."
/>
<User
username="Bob Smith"
avatar="https://s3.amazonaws.com/uifaces/faces/twitter/vladarbatov/128.jpg"
excerpt="I'm Bob smith, a vertically aligned type of guy. Lorem ipsum dolor sit amet, consectetur adipisicing elit."
/>
</Container>
```

If you are using Glamor in Part Two of the tutorials, the final Glamor page should look identical to the CSS Modules page.

![glamor-example](glamor-example.png)
6 changes: 3 additions & 3 deletions docs/docs/how-gatsby-works-with-github-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The easiest way to push a gatsby app to github pages is using a package called `

`yarn add --dev gh-pages`

## Github repository page
## GitHub repository page

Add a `deploy` script to `package.json`

Expand All @@ -28,7 +28,7 @@ We are using prefix paths because our website is inside a folder `http://usernam

When you run `yarn run deploy` all contents of `public` folder will be moved to your repositorys `gh-pages` branch.

## Github Organization or User page
## GitHub Organization or User page

First thing is to create a repository which should be named `username.github.io`.

Expand All @@ -43,4 +43,4 @@ In this case we dont need to specify `pathPrefix`, but our website needs to be p
}
```

After running `yarn run deplploy` you should see your website at `http://username.github.io`
After running `yarn run deploy` you should see your website at `http://username.github.io`
11 changes: 11 additions & 0 deletions docs/docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ root.

## Official plugins

* [gatsby-plugin-canonical-urls](/packages/gatsby-plugin-canonical-urls/)
* [gatsby-plugin-catch-links](/packages/gatsby-plugin-catch-links/)
* [gatsby-plugin-create-client-paths](/packages/gatsby-plugin-create-client-paths/)
* [gatsby-plugin-coffeescript](/packages/gatsby-plugin-coffeescript/)
Expand Down Expand Up @@ -133,7 +134,9 @@ root.
* [gatsby-plugin-antd](https://github.com/bskimball/gatsby-plugin-antd)
* [gatsby-plugin-copy](https://github.com/aquilio/gatsby-plugin-copy)
* [gatsby-plugin-elasticlunr-search](https://github.com/andrew-codes/gatsby-plugin-elasticlunr-search)
* [gatsby-plugin-fastclick](https://github.com/escaladesports/gatsby-plugin-fastclick)
* [gatsby-plugin-google-fonts](https://github.com/didierfranc/gatsby-plugin-google-fonts)
* [gatsby-plugin-gosquared](https://github.com/jongold/gatsby-plugin-gosquared)
* [gatsby-plugin-hotjar](https://github.com/pavloko/gatsby-plugin-hotjar)
* [gatsby-plugin-i18n-readnext](https://github.com/angeloocana/gatsby-plugin-i18n-readnext)
* [gatsby-plugin-i18n-tags](https://github.com/angeloocana/gatsby-plugin-i18n-tags)
Expand All @@ -146,7 +149,9 @@ root.
* [gatsby-plugin-segment-js](https://github.com/benjaminhoffman/gatsby-plugin-segment-js)
* [gatsby-plugin-stripe-checkout](https://github.com/njosefbeck/gatsby-plugin-stripe-checkout)
* [gatsby-plugin-stripe-elements](https://github.com/njosefbeck/gatsby-plugin-stripe-elements)
* [gatsby-plugin-svg-sprite](https://github.com/marcobiedermann/gatsby-plugin-svg-sprite)
* [gatsby-plugin-svgr](https://github.com/zabute/gatsby-plugin-svgr)
* [gatsby-plugin-typescript-css-modules](https://github.com/jcreamer898/gatsby-plugin-typescript-css-modules)
* [gatsby-plugin-yandex-metrika](https://github.com/viatsko/gatsby-plugin-yandex-metrika)
* [gatsby-remark-emoji](https://github.com/Rulikkk/gatsby-remark-emoji)
* [gatsby-remark-external-links](https://github.com/JLongley/gatsby-remark-external-links)
Expand All @@ -161,3 +166,9 @@ root.
* [gatsby-source-stripe](https://github.com/njosefbeck/gatsby-source-stripe)
* [gatsby-source-twitch](https://github.com/jedidiah/gatsby-source-twitch)
* [gatsby-source-workable](https://github.com/tumblbug/gatsby-source-workable)

## Community Library

* [gatsby-node-helpers](https://github.com/angeloashmore/gatsby-node-helpers)
* [gatsby-paginate](https://github.com/pixelstew/gatsby-paginate)
* [gatsby-pagination](https://github.com/infinitedescent/gatsby-pagination)
2 changes: 1 addition & 1 deletion docs/docs/querying-with-graphql.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ look for \`template literal blocks\` with `allNode{}` in them.

* [GraphQL specification](https://facebook.github.io/graphql/October2016/)
* [Interfaces and Unions](https://medium.com/the-graphqlhub/graphql-tour-interfaces-and-unions-7dd5be35de0d)
* [Gatsby uses the Relay Compiler](https://facebook.github.io/relay/docs/en/relay-compiler.html)
* [Gatsby uses the Relay Compiler](https://facebook.github.io/relay/docs/en/compiler-architecture.html)
* ...

## TODO — create live GraphQL explorer for GatsbyJS.org
Expand Down
Loading

0 comments on commit e520863

Please sign in to comment.