Skip to content

Commit

Permalink
Merge branch 'master' into parallel-sketch
Browse files Browse the repository at this point in the history
  • Loading branch information
Moocar committed Jan 9, 2019
2 parents 7a86ee1 + 8a6ad70 commit f629eaa
Show file tree
Hide file tree
Showing 103 changed files with 633 additions and 128 deletions.
37 changes: 37 additions & 0 deletions .forestry/front_matter/templates/blog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
label: blog
hide_body: false
is_partial: false
fields:
- name: title
label: Title
type: text
hidden: false
default: ''
- name: date
label: Date
type: datetime
hidden: false
default: ''
- name: author
label: Author
type: text
hidden: false
default: ''
- name: tags
label: Tags
type: tag_list
hidden: false
default: ''
- name: image
label: Image
type: file
hidden: false
default: ''
- name: showImageInArticle
label: 'Show Image? '
type: boolean
hidden: false
default: ''
pages:
- docs/blog/gatsby-days-talks-are-here.md
8 changes: 8 additions & 0 deletions .forestry/front_matter/templates/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
label: Docs
hide_body: false
is_partial: false
fields:
- type: text
name: title
label: Title
41 changes: 41 additions & 0 deletions .forestry/settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
new_page_extension: md
auto_deploy: false
admin_path:
webhook_url:
sections:
- type: heading
label: Content
- type: directory
path: docs/blog
label: Blog Posts
create: all
match: "**/*.md"
templates:
- blog
- type: directory
path: docs/docs
label: Docs
create: all
match: "**/*.md"
templates:
- making-a-site-with-user-authentication
- type: document
path: docs/blog/author.yaml
label: Authors
- type: document
path: docs/sites.yml
label: Featured Sites
- type: document
path: docs/starters.yml
label: Starters
upload_dir: www/src/uploads
public_path: "/src/uploads"
front_matter_path: ''
use_front_matter_path: false
file_template: ":filename:"
build:
preview_command: npm run forestry:preview
preview_env:
- BUILD_DIR=www/
output_directory: www/public
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ infrastructure

# coverage
coverage

# forestry files
.forestry/**/*
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Using unstructured data in Gatsby
title: Using Gatsby without GraphQL
date: 2018-10-25
author: Amberley Romo
tags: ["sourcing", "data"]
Expand All @@ -16,7 +16,7 @@ Gatsby’s rich data plugin ecosystem lets you build sites with the data you wan
</figcaption>
</figure>

Most examples in the Gatsby docs and on the web at large focus on leveraging source plugins to manage your data in Gatsby sites. And rightly so! Gatsby's data layer is powerful and extremely effective; it solves the "integration problem" of decoupled CMSs -- it's the glue between presentation layer and wherever your data is sourced from.
Most examples in the Gatsby docs and on the web at large focus on leveraging source plugins to manage your data in Gatsby sites. And rightly so! Gatsby's GraphQL data layer is powerful and extremely effective; it solves the "integration problem" of decoupled CMSs -- it's the glue between presentation layer and wherever your data is sourced from.

<figure>
<img alt="" height="400" src="./integration_layer.png" />
Expand All @@ -25,11 +25,11 @@ Most examples in the Gatsby docs and on the web at large focus on leveraging sou
</figcaption>
</figure>

> _[Source plugins](/docs/create-source-plugin/)_ “source” data from remote or local locations into Gatsby nodes. _[Gatsby nodes](/docs/node-interface/)_ are the center of Gatsby’s data handling layer.
> _[Source plugins](/docs/create-source-plugin/)_ “source” data from remote or local locations into Gatsby nodes, which are then queryable within your Gatsby site using GraphQL. _[Gatsby nodes](/docs/node-interface/)_ are the center of Gatsby’s data handling layer.
We're calling this the **"content mesh"** — the infrastructure layer for a decoupled website. ([Sam Bhagwat](https://twitter.com/calcsam) introduced and explored this concept in his recent five-part series, [The Journey to a Content Mesh](https://www.gatsbyjs.org/blog/2018-10-04-journey-to-the-content-mesh)).

**However, you don't _need_ to use source plugins (or create Gatsby nodes) to pull data into a Gatsby site!** In this post we'll explore how to use an "unstructured data" approach in Gatsby sites, and some of the pros and cons of doing so.
**However, you don't _need_ to use source plugins (or create Gatsby nodes) to pull data into a Gatsby site!** In this post we'll explore how to use Gatsby without GraphQL (using "unstructured data"), and some of the pros and cons of doing so.

> _Note_: For our purposes here, "unstructured data" means data "handled outside of Gatsby's data layer" i.e. using the data directly, and not transforming the data into Gatsby nodes.
Expand Down
32 changes: 32 additions & 0 deletions docs/blog/2019-01-09-gatsby-days-talks-are-here.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: Gatsby Days Talks are Here!
date: 2019-01-09T08:00:00+00:00
author: Linda Watkins
tags:
- Gatsby Days
- Presentations
- Talks
- Videos
image: "./images/Gatsby-Days copy.png"
showImageInArticle: true
---

The wait is over! Gatsby Days talks are posted below. Gatsby Days are one-day, in-person conferences on the modern website technology stack and the future of the web.

Get caught up on all the latest presentations from Gatsby Days in Mountain View, California such as Kyle Mathews' presentation on the future of the web, Chris Biscardi on Gatsby Themes, product announcements, how to sell Gatsby to your clients, and more. Check out the recordings below and if you'd like to see a Gatsby Days come to your city, [**cast your vote here**](https://www.gatsbyjs.com/gatsby-days-signup/).

### Gatsby Days Talks

[How We Got Here and The Future of Website Development](https://www.gatsbyjs.com/gatsby-days-keynote-kyle/) by **Kyle Mathews**, CEO and Co-founder, Gatsby

[Introducing Gatsby Themes](https://www.gatsbyjs.com/gatsby-days-themes-chris/) with **Chris Biscardi**, Developer, Gatsby

[Announcing Gatsby Preview: The Future is in the Cloud ](https://www.gatsbyjs.com/gatsby-days-preview-andrew/) with **Andrew Rhyne**, Cloud Services Engineer, Gatsby

[The Power of Positioning: Selling Gatsby to Your Clients](https://www.gatsbyjs.com/gatsby-days-positioning-linda/) by **Linda Watkins**, Director of Marketing, Gatsby

[The Journey to the Content Mesh](https://www.gatsbyjs.com/gatsby-days-content-mesh-sam/) with **Sam Bhagwat**, Co-Founder and Head of Enterprise, Gatsby

[How Gatsby Does High-Impact, Low-Effort UX Research (and You Can Too!)](https://www.gatsbyjs.com/gatsby-days-UXresearch-shannon/) by **Shannon Soper**, UX Specialist and Head of Learning, Gatsby

[Move Fast, Don't Break Things: Trends in Modern Web Development with Mediacurrent](https://www.gatsbyjs.com/gatsby-days-mediacurrent-ben/) by **Ben Robertson**, Front-End Developer, Mediacurrent
Binary file added docs/blog/images/Gatsby-Days copy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 8 additions & 2 deletions docs/docs/custom-html.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,24 @@ cp .cache/default-html.js src/html.js

And then make modifications as needed.

If you need to insert custom html into the `<head>` or `<footer>` of each page on your site, you can use `html.js`.

### Required props

Note: the various props that are rendered into pages _are_ required e.g.
`headComponents`, `preBodyComponents`, `body`, and `postBodyComponents`.

### React Helmet
### Inserting html into the <head>

Also, anything you render in the `html.js` component will _not_ be made "live" in
Anything you render in the `html.js` component will _not_ be made "live" in
the client like other components. If you want to dynamically update your
`<head>` we recommend using
[React Helmet](/packages/gatsby-plugin-react-helmet/)

### Inserting html into the <footer>

If you want to insert custom html into the footer, html.js is the preferred way of doing this. If you're writing a plugin, consider using the `setPostBodyComponents` prop in the [Gatsby SSR API](/docs/ssr-apis/).

### Target container

If you see this error: `Uncaught Error: _registerComponent(...): Target container is not a DOM element.` it means your `html.js` is missing the required
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/gatsby-lifecycle-apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ The sequence of the **main** bootstrap Node API lifecycles are:
- (schema update happens here)
- **extract queries from components** where the [queryCompiler](https://github.com/gatsbyjs/gatsby/blob/6de0e4408e14e599d4ec73948eb4153dc3cde849/packages/gatsby/src/internal-plugins/query-runner/query-compiler.js#L189) replaces page GraphQL queries and `StaticQueries`
- The [queries are run](https://github.com/gatsbyjs/gatsby/blob/6de0e4408e14e599d4ec73948eb4153dc3cde849/packages/gatsby/src/internal-plugins/query-runner/page-query-runner.js#L120), and the [pages are written out](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/internal-plugins/query-runner/pages-writer.js)
- [onPostBoostrap](https://www.gatsbyjs.org/docs/node-apis/#onPostBootstrap) is called (but it is not often used)
- [onPostBootstrap](https://www.gatsbyjs.org/docs/node-apis/#onPostBootstrap) is called (but it is not often used)

## Build sequence

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/node-creation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ A node is stored in redux under the `nodes` namespace, whose state is a map of t

## Sourcing Nodes

The creation of nodes occurs primarily in the [sourceNodes](/docs/node-apis/#sourceNodes) bootstrap phase. Nodes created during this phase are top level nodes. I.e, they have no parent. This is represented by source plugins setting the node's `parent` field to `___SOURCE___`. Nodes created via transform plugins (who implement [onCreateNode](/docs/node-apis/#onCreateNode)) will have source nodes as their parents, or other transformed nodes. For a rough overview of what happens when source nodes run, see the [traceID illustration](/docs/how-plugins-apis-are-run/#using-traceid-to-await-downstream-api-calls).
The creation of nodes occurs primarily in the [sourceNodes](/docs/node-apis/#sourceNodes) bootstrap phase. Nodes created during this phase are top level nodes. I.e, they have no parent. This is represented by source plugins setting the node's `parent` field to `null`. Nodes created via transform plugins (who implement [onCreateNode](/docs/node-apis/#onCreateNode)) will have source nodes as their parents, or other transformed nodes. For a rough overview of what happens when source nodes run, see the [traceID illustration](/docs/how-plugins-apis-are-run/#using-traceid-to-await-downstream-api-calls).

## Parent/Child/Refs

Expand Down
18 changes: 15 additions & 3 deletions docs/docs/submit-to-plugin-library.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,21 @@
title: Submit to Plugin Library
---

#### Publishing a plugin to the library
## Publishing a plugin to the library

In order to add your plugin to the [Plugin Library](/plugins/), you need to publish a package to npm (learn how [here](https://docs.npmjs.com/getting-started/publishing-npm-packages)) with the [required files](#what-files-does-gatsby-look-for-in-a-plugin) and **include a `keywords` field** to `package.json` containing `gatsby` and `gatsby-plugin`.
In order to add your plugin to the [Plugin Library](/plugins/), you need to:

1. publish a package to npm (learn how [here](https://docs.npmjs.com/getting-started/publishing-npm-packages)),
2. include the [required files](/docs/plugin-authoring/#what-files-does-gatsby-look-for-in-a-plugin) in your plugin code,
3. and **include a `keywords` field** in your plugin's `package.json`, containing `gatsby` and `gatsby-plugin`.

After doing so, Algolia will take up to 12 hours to add it to the library search index (the exact time necessary is still unknown), and wait for the daily rebuild of https://gatsbyjs.org to automatically include your plugin page to the website. Then, all you have to do is share your wonderful plugin with the community!

**NOTE:** You can include other _relevant_ keywords to your `package.json` file to help interested users in finding it. As an example, a Markdown MathJax transformer would include:
## Notes

### Keywords

You can include other _relevant_ keywords to your `package.json` file to help interested users in finding it. As an example, a Markdown MathJax transformer would include:

```json:title=package.json
"keywords": [
Expand All @@ -19,3 +27,7 @@ After doing so, Algolia will take up to 12 hours to add it to the library search
"markdown",
]
```

### Images

If you include images in your plugin repo's README, please make sure you are referencing the image using an absolute URL in order for the image to show on your plugin page.
14 changes: 13 additions & 1 deletion docs/sites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2245,12 +2245,13 @@
main_url: https://www.peterkroyer.at/en/
url: https://www.peterkroyer.at/en/
description: >
Freelance web designer / web developer based in Vienna, Austria.
Freelance web designer / web developer based in Vienna, Austria (Wien, Österreich).
categories:
- Agency
- Web Development
- Design
- Portfolio
- Freelance
built_by: Peter Kroyer
built_by_url: https://www.peterkroyer.at/
featured: false
Expand Down Expand Up @@ -3921,3 +3922,14 @@
built_by: Exposify
built_by_url: "https://www.exposify.de/"
featured: false
- title: Steak Point
main_url: https://www.steakpoint.at/
url: https://www.steakpoint.at/
description: >
Steak Restaurant in Vienna, Austria (Wien, Österreich).
categories:
- Restaurant
- Food
built_by: Peter Kroyer
built_by_url: https://www.peterkroyer.at/
featured: false
17 changes: 17 additions & 0 deletions docs/starters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1571,3 +1571,20 @@
- Styled with Tachyons.
- Rich structured data on blog posts for SEO.
- Pagination and category pages.
- url: https://gatsby-starter-styled.netlify.com/
repo: https://github.com/gregoralbrecht/gatsby-starter-styled
description: Yet another simple starter with Styled-System, Typography.js, SEO and Google Analytics.
tags:
- Styling:CSS-in-JS
- PWA
- SEO
features:
- Styled-Components
- Styled-System
- Rebass Grid
- Typography.js to easily set up font styles
- Google Analytics
- Prettier, ESLint & Stylelint
- SEO (meta tags and schema.org via JSON-LD)
- Offline support
- Web App Manifest
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ date: 2018-12-14
This is a truly meaningful blog post

<h2 data-testid="sub-title">%SUB_TITLE%</h2>

<h2 data-testid="gatsby-remark-subcache-value">%SUBCACHE_VALUE%</h2>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* This e2e test validates that the cache structure
* is unique per plugin (even sub-plugins)
* and can interact between Gatsby lifecycles and a plugin
*/
describe(`sub-plugin caching`, () => {
beforeEach(() => {
cy.visit(`/2018-12-14-hello-world/`).waitForAPI(`onRouteUpdate`)
})

it(`has access to custom sub-plugin cache`, () => {
cy.getTestElement(`gatsby-remark-subcache-value`)
.invoke(`text`)
.should(`eq`, `Hello World`)
})
})
2 changes: 1 addition & 1 deletion e2e-tests/development-runtime/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = {
{
resolve: `gatsby-transformer-remark`,
options: {
plugins: [],
plugins: [`gatsby-remark-subcache`],
},
},
`gatsby-plugin-sharp`,
Expand Down
4 changes: 2 additions & 2 deletions e2e-tests/development-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "1.0.0",
"author": "Dustin Schau <dustin@gatsbyjs.com>",
"dependencies": {
"gatsby": "^2.0.71",
"gatsby": "^2.0.88",
"gatsby-image": "^2.0.20",
"gatsby-plugin-manifest": "^2.0.9",
"gatsby-plugin-offline": "^2.0.20",
Expand All @@ -29,7 +29,7 @@
"serve": "gatsby serve",
"start": "npm run develop",
"format": "prettier --write \"src/**/*.js\"",
"test": "npm run start-server-and-test || npm run reset",
"test": "npm run start-server-and-test || (npm run reset && exit 1)",
"posttest": "npm run reset",
"reset": "node scripts/reset.js",
"update": "node scripts/update.js",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exports.id = `gatsby-remark-subcache-value`
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const { id } = require(`./constants`)

exports.onPreBootstrap = async ({ cache }) => {
await cache.set(id, `Hello World`)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const visit = require(`unist-util-visit`)
const { id } = require(`./constants`)

module.exports = function remarkPlugin({ cache, markdownAST }) {
visit(markdownAST, `html`, async node => {
if (node.value.match(id)) {
const value = await cache.get(id)
node.value = node.value.replace(/%SUBCACHE_VALUE%/, value)
}
})
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name": "gatsby-remark-subcache"
}
19 changes: 19 additions & 0 deletions e2e-tests/production-runtime/cypress/integration/global-styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const zIndex = `9001`

describe(`Global style from gatsby-browser.js`, () => {
beforeEach(() => {
cy.visit(`/global-style`).waitForAPI(`onRouteUpdate`)
})

it(`should apply any styles in root gatsby-browser.js`, () => {
cy.getTestElement(`global-style`).should(`have.css`, `zIndex`, zIndex)
})

it(`should apply any styles in plugin(s) gatsby-browser.js`, () => {
cy.getTestElement(`global-plugin-style`).should(
`have.css`,
`zIndex`,
zIndex
)
})
})
2 changes: 2 additions & 0 deletions e2e-tests/production-runtime/gatsby-browser.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require(`./src/index.css`)

if (typeof window !== `undefined`) {
window.___PageComponentLifecycleCallsLog = []
}
Expand Down
1 change: 1 addition & 0 deletions e2e-tests/production-runtime/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = {
},
plugins: [
`gatsby-plugin-react-helmet`,
`gatsby-plugin-global-style`,
{
resolve: `gatsby-plugin-manifest`,
options: {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import './index.css'
Loading

0 comments on commit f629eaa

Please sign in to comment.