Skip to content

Gatsby Migration #938

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Nov 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 68 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,70 @@
*.swp
*~
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

old
# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# dotenv environment variable files
.env*

# gatsby files
.cache/
public

# Mac files
.DS_Store
.nvmrc
node_modules
npm-debug.log

/build/
.tmp.*
package-lock.json
# Yarn
yarn-error.log
.pnp/
.pnp.js
# Yarn Integrity file
.yarn-integrity
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.cache
package.json
package-lock.json
public
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"arrowParens": "avoid",
"semi": false
}
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# Source Repository for graphql.org
This repository contains the source code of https://graphql.org website.

# Contributing

Organization gh-pages deploy the `master` branch, so active development occurs
on this `source` branch.

The site is written in JS and Markdown files in `site/`.

The site chrome are all in JS files in `site/_core/`.

### Making changes

The first time, get all the dependencies loaded via
Expand All @@ -17,9 +16,20 @@ Then, run the server via

`$ npm start` or `$ yarn start`

Open [http://localhost:8444](http://localhost:8444) to view it in the browser.
Open [http://localhost:8000](http://localhost:8000) to view it in the browser.
Anytime you make some changes, refresh the page to see the updates.

### Folder structure

- `static` folder contains the files that will be copied directly to `public` folder which will contain the output files to be served by a static HTTP server.

- `src` folder contains markdown and TypeScript/JavaScript files used to generate the website;
- - `assets` folder contains `less` files and those files contain stylesheets
- - `components` and `Containers` folders contains React components that are used in layouts and pages
- - `content` folder contains markdown files for the content of pages
- - `templates` contains the layout templates
- - `utils` contains helper functions

### Publish the Website

Once pushed to the `source` branch, Travis CI will publish http://graphql.org
Once pushed to the `source` branch, CI will publish http://graphql.org
108 changes: 108 additions & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
module.exports = {
siteMetadata: {
title: "A query language for your API",
description:
"GraphQL provides a complete description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.",
siteUrl: "http://graphql.org/",
},

plugins: [
"gatsby-plugin-react-helmet",
'gatsby-plugin-anchor-links',
{
resolve: "gatsby-source-filesystem",
options: {
name: "content",
path: `${__dirname}/src/content`,
include: ["**/*.md"], // ignore files starting with a dot
},
},
`gatsby-transformer-remark`,
{
resolve: `gatsby-plugin-webfonts`,
options: {
fonts: {
google: [
{
family: `Rubik`,
variants: [`300`],
},
{
family: `Roboto Mono`,
variants: [`400`, `400i`, `600`],
},
{
family: `Roboto`,
variants: [`300`],
},
],
},
},
},
`gatsby-plugin-less`,
`gatsby-plugin-react-helmet`,
{
resolve: `gatsby-plugin-google-analytics`,
options: {
trackingId: "UA-44373548-16",
},
},
{
resolve: "gatsby-plugin-feed",
options: {
query: `
{
site {
siteMetadata {
siteUrl
}
}
}
`,
feeds: [
{
serialize: ({ query: { site, allMarkdownRemark } }) =>
allMarkdownRemark.edges.map(
({
node: {
excerpt,
frontmatter: { title, date, permalink, byline },
},
}) => ({
title,
date,
url: site.siteMetadata.siteUrl + permalink,
description: excerpt,
author: byline,
})
),
query: `
{
allMarkdownRemark(
filter: {frontmatter: {layout: {eq: "blog"}}},
sort: { order: DESC, fields: [frontmatter___date] }
) {
edges {
node {
excerpt
frontmatter {
title
date
permalink
byline
}
}
}
}
}
`,
output: "/blog/rss.xml",
title: "Blog | GraphQL",
feed_url: "http://graphql.org/blog/rss.xml",
site_url: "http://graphql.org",
},
],
},
},
],
}
Loading