Skip to content

Commit

Permalink
Merge branch 'master' into integrate-localizations
Browse files Browse the repository at this point in the history
  • Loading branch information
tesseralis authored Jan 22, 2020
2 parents 43aed34 + 3815740 commit 427723c
Show file tree
Hide file tree
Showing 18 changed files with 132 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ The first question is clear; you can keep using the same hosting provider and pl

![Deploying static site](./images/illustration-02.png)

The answer to the second question is a bit more complicated. A static site needs to be regenerated every time the content or the site's source code is changed. We are using the Travis CI tool for automatic build and deployment to GitHub Pages. When there is an implementation change (push to GitHub repository), Travis is invoked automatically. For content changes, we are using [Kentico Cloud webhooks](http://bit.ly/2QzOdeS) - this works flawlessly! Whenever an editor publishes a new content item, webhook notification triggers a Travis build. Travis pulls the content from Kentico Cloud, fetches source code from GitHub, and after few moments of magic combines them into a nice set of static files - your static site. The last step of Travis is deployment to GitHub Pages.
The answer to the second question is a bit more complicated. A static site needs to be regenerated every time the content or the site's source code is changed. We are using the Travis CI tool for automatic build and deployment to GitHub Pages. When there is an implementation change (push to GitHub repository), Travis is invoked automatically. For content changes, we are using [Kentico Cloud webhooks](https://docs.kontent.ai/tutorials/develop-apps/integrate/using-webhooks-for-automatic-updates) - this works flawlessly! Whenever an editor publishes a new content item, webhook notification triggers a Travis build. Travis pulls the content from Kentico Cloud, fetches source code from GitHub, and after few moments of magic combines them into a nice set of static files - your static site. The last step of Travis is deployment to GitHub Pages.

## Build a Static Site Today

Expand Down
20 changes: 9 additions & 11 deletions docs/contributing/docs-and-website-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ title: Docs and Website Components
tableOfContentsDepth: 2
---

import LayerModel from "../../www/src/components/layer-model"
import HorizontalNavList from "../../www/src/components/horizontal-nav-list"
import Breadcrumb from "../../www/src/components/docs-breadcrumb"
import { itemListContributing } from "../../www/src/utils/sidebar/item-list"
import TableOfContents from "../../www/src/components/docs-table-of-contents"
Expand Down Expand Up @@ -130,14 +128,6 @@ Rendered, the component looks like this:
To improve is to change, so to be perfect is to have changed often.
</Pullquote>

---

## Other available components

Other less commonly used components aren't globally available, but can imported at the top of a Markdown file and used in other docs.

---

### Layer Model

The `<LayerModel />` was made to help explain concepts of how Gatsby works at a high level. It conceptually breaks Gatsby into different layers and shows how data is pulled, aggregated, and eventually rendered as an app. It's used on docs pages to help explain how Gatsby works at different levels.
Expand Down Expand Up @@ -168,7 +158,7 @@ When used, it looks like this:

### Horizontal Navigation List

The `<HorizontalNavList />` was made for the [Glossary](/docs/glossary/), and renders a list of links to alphabetical subheadings on the page in a horizontal format. Because of its specific use case, it isn't made globally available but can be imported if needed on other pages.
The `<HorizontalNavList />` was made for the [Glossary](/docs/glossary/), and renders a list of links to alphabetical subheadings on the page in a horizontal format.

#### Usage

Expand Down Expand Up @@ -212,6 +202,14 @@ items={[
slug={props.slug}
/>

---

## Other available components

Other less commonly used components aren't globally available, but can imported at the top of a Markdown file and used in other docs.

---

### Breadcrumb

The `<Breadcrumb />` component is used in layout files to display the hierarchy of pages a user is currently browsing on.
Expand Down
2 changes: 0 additions & 2 deletions docs/contributing/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ title: Contributing to Gatsby.js
disableTableOfContents: true
---

import EmailCaptureForm from "../../www/src/components/email-capture-form"

Thanks for being interested in contributing! We're so glad you want to help!

Below you'll find guides on the Gatsby.js community, code of conduct, and how to get started contributing:
Expand Down
2 changes: 0 additions & 2 deletions docs/docs/building-with-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
title: Building with Components
---

import LayerModel from "../../www/src/components/layer-model"

To use Gatsby, you will need a basic understanding of React components.

The [official tutorial](https://reactjs.org/tutorial/tutorial.html)
Expand Down
2 changes: 0 additions & 2 deletions docs/docs/gatsby-lifecycle-apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
title: Gatsby Lifecycle APIs
---

import LayerModel from "../../www/src/components/layer-model"

Gatsby provides a rich set of lifecycle APIs to hook into its bootstrap,
build, and client runtime operations.

Expand Down
2 changes: 0 additions & 2 deletions docs/docs/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ title: Glossary
disableTableOfContents: true
---

import HorizontalNavList from "../../www/src/components/horizontal-nav-list.js"

When you're new to Gatsby there can be a lot of words to learn. This glossary aims to give you a 10,000-foot overview of common terms and what they mean for Gatsby sites.

<HorizontalNavList
Expand Down
2 changes: 0 additions & 2 deletions docs/docs/graphql-concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
title: GraphQL Concepts
---

import LayerModel from "../../www/src/components/layer-model"

There are many options for loading data into React components. One of the most
popular and powerful of these is a technology called
[GraphQL](http://graphql.org/).
Expand Down
2 changes: 0 additions & 2 deletions docs/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ title: Gatsby.js Documentation
disableTableOfContents: true
---

import EmailCaptureForm from "../../www/src/components/email-capture-form"

Gatsby is a blazing fast modern site generator for React.

## Get Started
Expand Down
2 changes: 0 additions & 2 deletions docs/docs/overview-of-the-gatsby-build-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
title: Overview of the Gatsby Build Process
---

import LayerModel from "../../www/src/components/layer-model"

<!-- written at the time of commit e85278c to bootstrap/index.js and commit f8cae16 to build.js -->

_This is a high-level overview about the steps in the Gatsby build process. For more detailed information about specific steps, check out the [Gatsby Internals](/docs/gatsby-internals) section of the docs._
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/recipes/styling-css.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ import "./styles.scss"
import "./styles.sass"
```

_Note: You can use Sass/SCSS files as modules too, like mentioned in the previous recipe about CSS modules, with the difference that instead of `.css` the extensions have to be `.scss` or `.sass_`
_Note: You can use Sass/SCSS files as modules too, like mentioned in the previous recipe about CSS modules, with the difference that instead of `.css` the extensions have to be `.scss` or `.sass`_

### Additional resources

Expand Down
12 changes: 12 additions & 0 deletions docs/sites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9397,3 +9397,15 @@
built_by: Krishna Gopinath
built_by_url: https://twitter.com/krishwader
featured: false
- title: labelmake.jp
main_url: https://labelmake.jp/
url: https://labelmake.jp/
description: >
Web Application of Variable Data Printing and Blog.
categories:
- App
- Data
- Blog
built_by: hand-dot
built_by_url: https://twitter.com/hand_dot
featured: false
113 changes: 97 additions & 16 deletions packages/gatsby/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
import * as React from "react"
import { EventEmitter } from "events"
import { WindowLocation } from "@reach/router"
import { WindowLocation, NavigateFn } from "@reach/router"
import { createContentDigest } from "gatsby-core-utils"
import {
ComposeEnumTypeConfig,
ComposeInputObjectTypeConfig,
ComposeInterfaceTypeConfig,
ComposeObjectTypeConfig,
ComposeScalarTypeConfig,
ComposeUnionTypeConfig,
} from "graphql-compose"
import { GraphQLOutputType } from "graphql"

export {
default as Link,
Expand Down Expand Up @@ -112,7 +121,9 @@ export interface GatsbyNode {
* @see https://www.gatsbyjs.org/docs/node-apis/#createPages
*/
createPages?(
args: CreatePagesArgs & { traceId: "initial-createPages" },
args: CreatePagesArgs & {
traceId: "initial-createPages"
},
options?: PluginOptions,
callback?: PluginCallback
): void
Expand All @@ -132,7 +143,9 @@ export interface GatsbyNode {
* add and remove pages.
*/
createPagesStatefully?(
args: CreatePagesArgs & { traceId: "initial-createPagesStatefully" },
args: CreatePagesArgs & {
traceId: "initial-createPagesStatefully"
},
options?: PluginOptions,
callback?: PluginCallback
): void
Expand Down Expand Up @@ -181,8 +194,8 @@ export interface GatsbyNode {
* // create a new node field.
* }
*/
onCreateNode?(
args: CreateNodeArgs,
onCreateNode?<TNode extends object = {}>(
args: CreateNodeArgs<TNode>,
options?: PluginOptions,
callback?: PluginCallback
): void
Expand All @@ -195,8 +208,8 @@ export interface GatsbyNode {
* See the guide [Creating and Modifying Pages](https://www.gatsbyjs.org/docs/creating-and-modifying-pages/)
* for more on this API.
*/
onCreatePage?(
args: CreatePageArgs,
onCreatePage?<TNode extends object = {}>(
args: CreatePageArgs<TNode>,
options?: PluginOptions,
callback?: PluginCallback
): void
Expand Down Expand Up @@ -648,17 +661,19 @@ export interface CreateDevServerArgs extends ParentSpanPluginArgs {
app: any
}

export interface CreateNodeArgs extends ParentSpanPluginArgs {
node: Node
export interface CreateNodeArgs<TNode extends object = {}>
extends ParentSpanPluginArgs {
node: Node & TNode
traceId: string
traceTags: {
nodeId: string
nodeType: string
}
}

export interface CreatePageArgs extends ParentSpanPluginArgs {
page: Node
export interface CreatePageArgs<TNode extends object = {}>
extends ParentSpanPluginArgs {
page: Node & TNode
traceId: string
}

Expand Down Expand Up @@ -687,6 +702,61 @@ export interface SetFieldsOnGraphQLNodeTypeArgs extends ParentSpanPluginArgs {
traceId: "initial-setFieldsOnGraphQLNodeType"
}

export interface GatsbyGraphQLObjectType {
kind: "OBJECT"
config: ComposeObjectTypeConfig<any, any>
}

interface GatsbyGraphQLInputObjectType {
kind: "INPUT_OBJECT"
config: ComposeInputObjectTypeConfig
}

interface GatsbyGraphQLUnionType {
kind: "UNION"
config: ComposeUnionTypeConfig<any, any>
}

interface GatsbyGraphQLInterfaceType {
kind: "INTERFACE"
config: ComposeInterfaceTypeConfig<any, any>
}

interface GatsbyGraphQLEnumType {
kind: "ENUM"
config: ComposeEnumTypeConfig
}

interface GatsbyGraphQLScalarType {
kind: "SCALAR"
config: ComposeScalarTypeConfig
}

export type GatsbyGraphQLType =
| GatsbyGraphQLObjectType
| GatsbyGraphQLInputObjectType
| GatsbyGraphQLUnionType
| GatsbyGraphQLInterfaceType
| GatsbyGraphQLEnumType
| GatsbyGraphQLScalarType

export interface NodePluginSchema {
buildObjectType(
config: ComposeObjectTypeConfig<any, any>
): GatsbyGraphQLObjectType
buildUnionType(
config: ComposeUnionTypeConfig<any, any>
): GatsbyGraphQLUnionType
buildInterfaceType(
config: ComposeInterfaceTypeConfig<any, any>
): GatsbyGraphQLInterfaceType
buildInputObjectType(
config: ComposeInputObjectTypeConfig
): GatsbyGraphQLInputObjectType
buildEnumType(config: ComposeEnumTypeConfig): GatsbyGraphQLEnumType
buildScalarType(config: ComposeScalarTypeConfig): GatsbyGraphQLScalarType
}

export interface SourceNodesArgs extends ParentSpanPluginArgs {
traceId: "initial-sourceNodes"
waitForCascadingActions: boolean
Expand All @@ -711,7 +781,10 @@ export interface PreRenderHTMLArgs extends NodePluginArgs {
replacePostBodyComponents: (comp: React.ReactNode[]) => void
}

type ReactProps<T extends Element> = React.DetailedHTMLProps<React.HTMLAttributes<T>, T>
type ReactProps<T extends Element> = React.DetailedHTMLProps<
React.HTMLAttributes<T>,
T
>
export interface RenderBodyArgs extends NodePluginArgs {
pathname: string
setHeadComponents: (comp: React.ReactNode[]) => void
Expand Down Expand Up @@ -763,6 +836,7 @@ export interface NodePluginArgs {
createNodeId: Function
createContentDigest: typeof createContentDigest
tracing: Tracing
schema: NodePluginSchema
[key: string]: unknown
}

Expand Down Expand Up @@ -929,7 +1003,13 @@ export interface Actions {

/** @see https://www.gatsbyjs.org/docs/actions/#createTypes */
createTypes(
types: string | object | Array<string | object>,
types:
| string
| GraphQLOutputType
| GatsbyGraphQLType
| string[]
| GraphQLOutputType[]
| GatsbyGraphQLType[],
plugin?: ActionPlugin,
traceId?: string
): void
Expand Down Expand Up @@ -1135,12 +1215,13 @@ export interface ReplaceComponentRendererArgs extends BrowserPluginArgs {
path: string
"*": string
uri: string
location: object
navigate: Function
location: Location
navigate: NavigateFn
children: undefined
pageResources: object
data: object
pageContext: object
pageContext: Record<string, unknown>
pathContext: Record<string, unknown>
}
loader: object
}
Expand Down
2 changes: 1 addition & 1 deletion www/src/components/showcase-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ const ShowcaseDetails = ({ parent, data, isModal, categories }) => (
{categories.map((c, i) => (
<Fragment key={c}>
<Link
to={`/showcase?${qs.stringify({ filters: [c] })}`}
to={`/showcase/?${qs.stringify({ filters: [c] })}`}
state={{ isModal: true }}
sx={styles.link}
>
Expand Down
6 changes: 6 additions & 0 deletions www/src/gatsby-plugin-theme-ui/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import HubspotForm from "../components/hubspot-form"
import Pullquote from "../components/shared/pullquote"
import EggheadEmbed from "../components/shared/egghead-embed"
import DateChart from "../components/chart"
import LayerModel from "../components/layer-model"
import EmailCaptureForm from "../components/email-capture-form"
import HorizontalNavList from "../components/horizontal-nav-list"
import CodeBlock from "../components/code-block"
import MdxLink from "../components/mdx-link"

Expand All @@ -14,6 +17,9 @@ export default {
DateChart,
Pullquote,
EggheadEmbed,
LayerModel,
EmailCaptureForm,
HorizontalNavList,
a: MdxLink,
pre: ({ children }) => <CodeBlock>{children}</CodeBlock>,
}
4 changes: 2 additions & 2 deletions www/src/templates/template-showcase-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ class ShowcaseTemplate extends React.Component {
const queryString = qs.stringify({
filters: this.props.location.state.filters,
})
return `/showcase?${queryString}`
return `/showcase/?${queryString}`
} else {
return `/showcase`
return `/showcase/`
}
}

Expand Down
2 changes: 1 addition & 1 deletion www/src/views/showcase/featured-sites.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class FeaturedSites extends Component {
Want to get featured?
</div>
<Button
to="https://gatsbyjs.org/contributing/site-showcase-submissions/"
to="https://www.gatsbyjs.org/contributing/site-showcase-submissions/"
tag="href"
target="_blank"
rel="noopener noreferrer"
Expand Down
Loading

0 comments on commit 427723c

Please sign in to comment.