Skip to content

Migrate to Gatsby 🚀 #896

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 36 commits into from
Sep 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
8de6e59
remove old site
saihaj Jul 21, 2020
825c258
initialize gatsby project
saihaj Jul 6, 2020
b6c1705
feat: setup styling
saihaj Jul 7, 2020
f644589
feat: nav bar components
saihaj Jul 7, 2020
83896bb
feat: footer component
saihaj Jul 7, 2020
c14f717
feat: search component
saihaj Jul 7, 2020
e62df8c
feat: 404 page
saihaj Jul 7, 2020
aa33bc1
setup basic index page
saihaj Jul 7, 2020
bc0d518
add user logos
saihaj Jul 7, 2020
3b1d008
fix: use gatsby backgrund image
saihaj Jul 7, 2020
00f6f35
build(deps): add new
saihaj Jul 7, 2020
143cdd8
fix: use body instead of div
saihaj Jul 7, 2020
eb7d892
feat: add syntax highlighting use prism-react-renderer
saihaj Jul 7, 2020
a485980
:tada:feat: clone homepage
saihaj Jul 7, 2020
6f50acd
build: remove purgecss
saihaj Jul 7, 2020
b8366fc
feat: setup gatsby transformer remark for markdown
saihaj Jul 9, 2020
ec33312
feat: render docs using gatsby node
saihaj Jul 12, 2020
16872cb
docs: community docs
saihaj Jul 12, 2020
eec0f16
feat: add gatsby-remark-autolink-headers
saihaj Jul 12, 2020
b0d6128
feat: setup sidebars
saihaj Jul 21, 2020
4529dbb
feat: add code highlighting
saihaj Jul 21, 2020
eb7d3a8
feat: add graphql js docs
saihaj Jul 22, 2020
4538e51
feat: add users page
saihaj Jul 22, 2020
56d0fda
fix: skip create page if not layout specified
saihaj Jul 22, 2020
2b4a6ed
refactor: move logic to a sperate component
saihaj Jul 22, 2020
ad6718a
feat: blog posts
saihaj Jul 23, 2020
cbcb4d6
fix: image rendering issue inside .md
saihaj Jul 23, 2020
81c4391
rename directories
saihaj Jul 23, 2020
dfb6027
docs: update contributing docs
saihaj Jul 23, 2020
b6ca209
fix: use sidebar title where available
saihaj Jul 25, 2020
59a977e
fix: sidebard order of items
saihaj Jul 25, 2020
404d11f
fix: prop type errors
saihaj Jul 29, 2020
0c0aa58
Overrided code class to resolve borders occuring for every line of co…
iravitejakumar Aug 19, 2020
4b1d04e
Merge remote-tracking branch 'upstream/source' into source
saihaj Aug 28, 2020
09afae0
Merge remote-tracking branch 'upstream/source' into source
saihaj Sep 3, 2020
a95f19b
build: remove author field
saihaj Sep 4, 2020
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
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
public
node_modules
54 changes: 54 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": ["airbnb"],
"parser": "babel-eslint",
"rules": {
"array-bracket-spacing": ["error","always"],
"computed-property-spacing": ["error","always"],
"func-names": ["error","never"],
"semi": ["error","never"],
"semi-style": ["error","first"],
"import/extensions": 0,
"import/no-unresolved": 0,
"import/prefer-default-export": 0,
"jsx-a11y/anchor-is-valid": 0,
"import/no-extraneous-dependencies": 0,
"linebreak-style": 0,
"no-await-in-loop": 0,
"no-loop-func": 0,
"no-restricted-syntax": 0,
"no-shadow": 0,
"no-unused-vars": 1,
"react/jsx-filename-extension": 0,
"react/state-in-constructor": 0,
"react/jsx-props-no-spreading": 0,
"react/sort-comp": 0,
"react/jsx-one-expression-per-line": 0,
"space-in-parens": [
"error",
"always",
{
"exceptions": [
"empty"
]
}
],
"object-curly-newline": [
"error",
{
"consistent": true
}
],
"arrow-parens": [
"error",
"as-needed",
{
"requireForBlockBody": false
}
]
}
}
75 changes: 67 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,69 @@
*.swp
*~
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# 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
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

26 changes: 0 additions & 26 deletions LICENSE

This file was deleted.

34 changes: 16 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
# Contributing

Organization gh-pages deploy the `master` branch, so active development occurs
on this `source` branch.
Created using [`gastby-starter-default`](https://github.com/gatsbyjs/gatsby-starter-default)

The site is written in JS and Markdown files in `site/`.
### Prerequisites
* [Git](https://git-scm.com/)
* [Node.JS](https://nodejs.org/en/) x64, version `>= 12.x`

The site chrome are all in JS files in `site/_core/`.
## Development Setup
* Install dependencies:
```
npm install
```
* Run the development server
```
npm start
```
:rocket: Development server -> http://localhost:8000

### Making changes

The first time, get all the dependencies loaded via
All the docs live in `src/content`. Relative paths can be used for images.

`$ npm install` or `$ yarn install`

Then, run the server via

`$ npm start` or `$ yarn start`

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

### Publish the Website

Once pushed to the `source` branch, Travis CI will publish http://graphql.org
`src/img` has sub-directories to help organize images.
1 change: 1 addition & 0 deletions gatsby-browser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import './src/css/style.less'
112 changes: 112 additions & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
module.exports = {
siteMetadata: {
title: 'GraphQL',
description: 'Gatsby Site for GraphQL.org',
siteUrl: 'http://graphql.org',
},
plugins: [
'gatsby-plugin-react-helmet',
'gatsby-plugin-less',
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'images',
path: `${__dirname}/src/img`,
},
},
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'content',
path: `${__dirname}/src/content`,
},
},
'gatsby-transformer-sharp',
'gatsby-plugin-sharp',
{
resolve: 'gatsby-plugin-manifest',
options: {
name: 'graphql-docs',
short_name: 'graphql',
start_url: '/',
icon: 'src/img/favicon.png',
},
},
{
resolve: 'gatsby-transformer-remark',
options: {
plugins: [
'gatsby-remark-autolink-headers',
{
resolve: 'gatsby-remark-prismjs',
options: {
classPrefix: 'prism language-',
},
},
{
resolve: 'gatsby-remark-images-anywhere',
options: {
staticDir: 'src/img',
},
},
],
},
},
{
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: "BlogPostLayout"}}},
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',
},
],
},
},
],
}
39 changes: 39 additions & 0 deletions gatsby-node.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
const path = require( 'path' )

exports.createPages = async ( { actions, graphql, reporter } ) => {
const { createPage } = actions

const result = await graphql( `
query AllContentPages {
allMarkdownRemark {
edges {
node {
id
frontmatter {
layout
permalink
}
}
}
}
}
` )

if ( result.errors ) reporter.panicOnBuild( '🚨 ERROR: Loading "createPages" query' )

const pages = result.data.allMarkdownRemark.edges

// Call `createPage` for each page
pages
.filter( ( { node: { frontmatter: { layout } } } ) => layout )
.forEach( ( { node: {
id,
frontmatter: { layout, permalink },
} } ) => {
createPage( {
path: permalink,
component: path.resolve( `src/templates/${layout}.js` ),
context: { id },
} )
} )
}
Loading