Skip to content

Commit 4fcbcbd

Browse files
authored
Merge pull request graphql#938 from ardatan/new-gatsby-migration
Gatsby Migration
2 parents 1a399ab + 045a165 commit 4fcbcbd

File tree

274 files changed

+16732
-6234
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

274 files changed

+16732
-6234
lines changed

.gitignore

Lines changed: 68 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,70 @@
1-
*.swp
2-
*~
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
old
9+
# Runtime data
10+
pids
11+
*.pid
12+
*.seed
13+
*.pid.lock
14+
15+
# Directory for instrumented libs generated by jscoverage/JSCover
16+
lib-cov
17+
18+
# Coverage directory used by tools like istanbul
19+
coverage
20+
21+
# nyc test coverage
22+
.nyc_output
23+
24+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
25+
.grunt
26+
27+
# Bower dependency directory (https://bower.io/)
28+
bower_components
29+
30+
# node-waf configuration
31+
.lock-wscript
32+
33+
# Compiled binary addons (http://nodejs.org/api/addons.html)
34+
build/Release
35+
36+
# Dependency directories
37+
node_modules/
38+
jspm_packages/
39+
40+
# Typescript v1 declaration files
41+
typings/
42+
43+
# Optional npm cache directory
44+
.npm
45+
46+
# Optional eslint cache
47+
.eslintcache
48+
49+
# Optional REPL history
50+
.node_repl_history
51+
52+
# Output of 'npm pack'
53+
*.tgz
54+
55+
# dotenv environment variable files
56+
.env*
57+
58+
# gatsby files
59+
.cache/
60+
public
61+
62+
# Mac files
363
.DS_Store
4-
.nvmrc
5-
node_modules
6-
npm-debug.log
764

8-
/build/
9-
.tmp.*
10-
package-lock.json
65+
# Yarn
66+
yarn-error.log
67+
.pnp/
68+
.pnp.js
69+
# Yarn Integrity file
70+
.yarn-integrity

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.cache
2+
package.json
3+
package-lock.json
4+
public

.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"arrowParens": "avoid",
3+
"semi": false
4+
}

.travis.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

README.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1+
# Source Repository for graphql.org
2+
This repository contains the source code of https://graphql.org website.
3+
14
# Contributing
25

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

6-
The site is written in JS and Markdown files in `site/`.
7-
8-
The site chrome are all in JS files in `site/_core/`.
9-
109
### Making changes
1110

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

1817
`$ npm start` or `$ yarn start`
1918

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

22+
### Folder structure
23+
24+
- `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.
25+
26+
- `src` folder contains markdown and TypeScript/JavaScript files used to generate the website;
27+
- - `assets` folder contains `less` files and those files contain stylesheets
28+
- - `components` and `Containers` folders contains React components that are used in layouts and pages
29+
- - `content` folder contains markdown files for the content of pages
30+
- - `templates` contains the layout templates
31+
- - `utils` contains helper functions
32+
2333
### Publish the Website
2434

25-
Once pushed to the `source` branch, Travis CI will publish http://graphql.org
35+
Once pushed to the `source` branch, CI will publish http://graphql.org

gatsby-config.js

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
module.exports = {
2+
siteMetadata: {
3+
title: "A query language for your API",
4+
description:
5+
"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.",
6+
siteUrl: "http://graphql.org/",
7+
},
8+
9+
plugins: [
10+
"gatsby-plugin-react-helmet",
11+
'gatsby-plugin-anchor-links',
12+
{
13+
resolve: "gatsby-source-filesystem",
14+
options: {
15+
name: "content",
16+
path: `${__dirname}/src/content`,
17+
include: ["**/*.md"], // ignore files starting with a dot
18+
},
19+
},
20+
`gatsby-transformer-remark`,
21+
{
22+
resolve: `gatsby-plugin-webfonts`,
23+
options: {
24+
fonts: {
25+
google: [
26+
{
27+
family: `Rubik`,
28+
variants: [`300`],
29+
},
30+
{
31+
family: `Roboto Mono`,
32+
variants: [`400`, `400i`, `600`],
33+
},
34+
{
35+
family: `Roboto`,
36+
variants: [`300`],
37+
},
38+
],
39+
},
40+
},
41+
},
42+
`gatsby-plugin-less`,
43+
`gatsby-plugin-react-helmet`,
44+
{
45+
resolve: `gatsby-plugin-google-analytics`,
46+
options: {
47+
trackingId: "UA-44373548-16",
48+
},
49+
},
50+
{
51+
resolve: "gatsby-plugin-feed",
52+
options: {
53+
query: `
54+
{
55+
site {
56+
siteMetadata {
57+
siteUrl
58+
}
59+
}
60+
}
61+
`,
62+
feeds: [
63+
{
64+
serialize: ({ query: { site, allMarkdownRemark } }) =>
65+
allMarkdownRemark.edges.map(
66+
({
67+
node: {
68+
excerpt,
69+
frontmatter: { title, date, permalink, byline },
70+
},
71+
}) => ({
72+
title,
73+
date,
74+
url: site.siteMetadata.siteUrl + permalink,
75+
description: excerpt,
76+
author: byline,
77+
})
78+
),
79+
query: `
80+
{
81+
allMarkdownRemark(
82+
filter: {frontmatter: {layout: {eq: "blog"}}},
83+
sort: { order: DESC, fields: [frontmatter___date] }
84+
) {
85+
edges {
86+
node {
87+
excerpt
88+
frontmatter {
89+
title
90+
date
91+
permalink
92+
byline
93+
}
94+
}
95+
}
96+
}
97+
}
98+
`,
99+
output: "/blog/rss.xml",
100+
title: "Blog | GraphQL",
101+
feed_url: "http://graphql.org/blog/rss.xml",
102+
site_url: "http://graphql.org",
103+
},
104+
],
105+
},
106+
},
107+
],
108+
}

0 commit comments

Comments
 (0)