diff --git a/website/tutorials/authentication-and-express-middleware.md b/website/docs/tutorials/authentication-and-express-middleware.md similarity index 100% rename from website/tutorials/authentication-and-express-middleware.md rename to website/docs/tutorials/authentication-and-express-middleware.md diff --git a/website/tutorials/basic-types.md b/website/docs/tutorials/basic-types.md similarity index 100% rename from website/tutorials/basic-types.md rename to website/docs/tutorials/basic-types.md diff --git a/website/tutorials/constructing-types.md b/website/docs/tutorials/constructing-types.md similarity index 100% rename from website/tutorials/constructing-types.md rename to website/docs/tutorials/constructing-types.md diff --git a/website/tutorials/express-graphql.md b/website/docs/tutorials/express-graphql.md similarity index 100% rename from website/tutorials/express-graphql.md rename to website/docs/tutorials/express-graphql.md diff --git a/website/tutorials/graphql-clients.md b/website/docs/tutorials/graphql-clients.md similarity index 100% rename from website/tutorials/graphql-clients.md rename to website/docs/tutorials/graphql-clients.md diff --git a/website/tutorials/hello.png b/website/docs/tutorials/hello.png similarity index 100% rename from website/tutorials/hello.png rename to website/docs/tutorials/hello.png diff --git a/website/tutorials/index.md b/website/docs/tutorials/index.md similarity index 99% rename from website/tutorials/index.md rename to website/docs/tutorials/index.md index d22d24bd5cc..d9c8aebe293 100644 --- a/website/tutorials/index.md +++ b/website/docs/tutorials/index.md @@ -1,6 +1,5 @@ --- title: Getting Started With GraphQL.js -slug: / --- ## Prerequisites diff --git a/website/tutorials/mutations-and-input-types.md b/website/docs/tutorials/mutations-and-input-types.md similarity index 100% rename from website/tutorials/mutations-and-input-types.md rename to website/docs/tutorials/mutations-and-input-types.md diff --git a/website/tutorials/object-types.md b/website/docs/tutorials/object-types.md similarity index 100% rename from website/tutorials/object-types.md rename to website/docs/tutorials/object-types.md diff --git a/website/tutorials/passing-arguments.md b/website/docs/tutorials/passing-arguments.md similarity index 100% rename from website/tutorials/passing-arguments.md rename to website/docs/tutorials/passing-arguments.md diff --git a/website/tutorials/running-an-express-graphql-server.md b/website/docs/tutorials/running-an-express-graphql-server.md similarity index 100% rename from website/tutorials/running-an-express-graphql-server.md rename to website/docs/tutorials/running-an-express-graphql-server.md diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index ba6000a1759..bf3000c56a5 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -5,122 +5,32 @@ const path = require('path'); const lightCodeTheme = require('prism-react-renderer/themes/github'); const darkCodeTheme = require('prism-react-renderer/themes/dracula'); -/** @type {import('@docusaurus/types').DocusaurusConfig} */ +/** @type {import('@docusaurus/types').Config} */ module.exports = { title: 'graphql-js', tagline: 'A reference implementation of GraphQL for JavaScript', url: 'https://graphql-js.graphql.org', baseUrl: '/', - onBrokenLinks: 'warn', // temporary need to find a way for typedoc generated docs to work - onBrokenMarkdownLinks: 'warn', + onBrokenLinks: 'throw', + onBrokenMarkdownLinks: 'throw', + onDuplicateRoutes: 'throw', favicon: 'img/favicon.ico', organizationName: 'graphql', projectName: 'graphql-js', - themeConfig: { - navbar: { - title: 'graphql-js', - logo: { - alt: 'GraphQL Logo', - src: 'img/logo.svg', - }, - items: [ - { - type: 'doc', - docId: 'index', - position: 'left', - label: 'Tutorial', - }, - { - href: 'https://github.com/graphql/graphql-js', - label: 'GitHub', - position: 'right', - }, - { - to: 'api/graphql-js', - label: 'API', - position: 'left', - }, - ], - }, - footer: { - style: 'dark', - links: [ - { - title: 'Docs', - items: [ - { - label: 'Tutorial', - to: 'tutorials', - }, - ], - }, - { - title: 'Community', - items: [ - { - label: 'Code of Conduct', - href: 'https://graphql.org/codeofconduct/', - }, - { - label: 'Stack Overflow', - href: 'https://stackoverflow.com/questions/tagged/graphql-js', - }, - { - label: 'Discord', - href: 'https://discord.graphql.org/', - }, - { - label: 'Twitter', - href: 'https://twitter.com/graphql', - }, - { - label: 'Upcoming Events', - href: 'https://graphql.org/community/upcoming-events/', - }, - ], - }, - { - title: 'More', - items: [ - { - label: 'GraphQL JS Working Group', - href: 'https://github.com/graphql/graphql-js-wg', - }, - { - label: 'GraphQL Foundation', - href: 'https://graphql.org/foundation', - }, - { - label: 'GraphQL Spec', - href: 'https://spec.graphql.org', - }, - ], - }, - ], - copyright: `Copyright © ${new Date().getFullYear()} The GraphQL Foundation. All rights reserved.
For web site terms of use, trademark policy and general project policies please see  https://lfprojects.org.`, - }, - prism: { - theme: lightCodeTheme, - darkTheme: darkCodeTheme, - }, - }, presets: [ [ '@docusaurus/preset-classic', - { - pages: { - path: './src/pages', - }, + /** @type {import('@docusaurus/preset-classic').Options} */ + ({ docs: { - path: './tutorials', - routeBasePath: 'tutorials', sidebarPath: require.resolve('./sidebars.js'), - editUrl: 'https://github.com/graphql/graphql-js/edit/main/docs/', + editUrl: + 'https://github.com/graphql/graphql-js/edit/main/website/docs/', }, theme: { customCss: require.resolve('./src/css/custom.css'), }, - }, + }), ], ], plugins: [ @@ -132,4 +42,94 @@ module.exports = { }, ], ], + themeConfig: + /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ + ({ + navbar: { + title: 'graphql-js', + logo: { + alt: 'GraphQL Logo', + src: 'img/logo.svg', + }, + items: [ + { + type: 'doc', + docId: 'tutorials/index', + position: 'left', + label: 'Tutorial', + }, + { + href: 'https://github.com/graphql/graphql-js', + label: 'GitHub', + position: 'right', + }, + { + to: 'api/graphql-js', + label: 'API', + position: 'left', + }, + ], + }, + footer: { + style: 'dark', + links: [ + { + title: 'Docs', + items: [ + { + label: 'Tutorial', + to: 'docs/tutorials/', + }, + ], + }, + { + title: 'Community', + items: [ + { + label: 'Code of Conduct', + href: 'https://graphql.org/codeofconduct/', + }, + { + label: 'Stack Overflow', + href: 'https://stackoverflow.com/questions/tagged/graphql-js', + }, + { + label: 'Discord', + href: 'https://discord.graphql.org/', + }, + { + label: 'Twitter', + href: 'https://twitter.com/graphql', + }, + { + label: 'Upcoming Events', + href: 'https://graphql.org/community/upcoming-events/', + }, + ], + }, + { + title: 'More', + items: [ + { + label: 'GraphQL JS Working Group', + href: 'https://github.com/graphql/graphql-js-wg', + }, + { + label: 'GraphQL Foundation', + href: 'https://graphql.org/foundation', + }, + { + label: 'GraphQL Spec', + href: 'https://spec.graphql.org', + }, + ], + }, + ], + copyright: `Copyright © ${new Date().getFullYear()} The GraphQL Foundation. All rights reserved.
For web site terms of use, trademark policy and general project policies please see  https://lfprojects.org.`, + }, + prism: { + theme: lightCodeTheme, + darkTheme: darkCodeTheme, + }, + }), }; diff --git a/website/sidebars.js b/website/sidebars.js index 6958a652b33..79fe5e9d8ba 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -2,19 +2,19 @@ module.exports = { tutorialSidebar: [ - 'index', - 'running-an-express-graphql-server', - 'graphql-clients', - 'basic-types', - 'passing-arguments', - 'object-types', - 'mutations-and-input-types', - 'authentication-and-express-middleware', + 'tutorials/index', + 'tutorials/running-an-express-graphql-server', + 'tutorials/graphql-clients', + 'tutorials/basic-types', + 'tutorials/passing-arguments', + 'tutorials/object-types', + 'tutorials/mutations-and-input-types', + 'tutorials/authentication-and-express-middleware', { type: 'category', label: 'Advanced', - items: ['constructing-types'], + items: ['tutorials/constructing-types'], }, - 'express-graphql', + 'tutorials/express-graphql', ], }; diff --git a/website/src/pages/index.jsx b/website/src/pages/index.jsx index 6c74212411f..5344893b79b 100644 --- a/website/src/pages/index.jsx +++ b/website/src/pages/index.jsx @@ -14,7 +14,10 @@ function HomepageHeader() {

{siteConfig.title}

{siteConfig.tagline}

- + Get Started