2022-03-28 12:12:27 +03:00
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const path = require ( 'path' ) ;
const lightCodeTheme = require ( 'prism-react-renderer/themes/vsLight' ) ;
const darkCodeTheme = require ( 'prism-react-renderer/themes/dracula' ) ;
/** @type {import('@docusaurus/types').Config} */
const config = {
title : 'Hasura GraphQL Docs' ,
tagline : 'Instant GraphQL on all your data' ,
url : 'https://hasura.io' ,
2024-08-15 17:17:28 +03:00
baseUrl : '/docs/2.0' ,
2022-03-28 12:12:27 +03:00
trailingSlash : true ,
onBrokenLinks : 'throw' ,
onBrokenMarkdownLinks : 'throw' ,
favicon : '/docs/img/favicon.png' ,
organizationName : 'hasura' ,
projectName : 'graphql-engine' ,
2022-07-20 19:34:24 +03:00
staticDirectories : [ 'static' , 'public' ] ,
2023-11-17 17:10:08 +03:00
customFields : {
2024-03-13 14:17:54 +03:00
docsBotEndpointURL : ( ( ) => {
console . log ( 'process.env.release_mode docs-bot' , process . env . release _mode ) ;
switch ( process . env . release _mode ) {
case 'development' :
return 'ws://localhost:8000/hasura-docs-ai' ;
case 'production' :
return 'wss://website-api.hasura.io/chat-bot/hasura-docs-ai' ;
case 'staging' :
return 'wss://website-api.stage.hasura.io/chat-bot/hasura-docs-ai' ;
default :
return 'ws://localhost:8000/hasura-docs-ai' ; // default to development if no match
}
} ) ( ) ,
2023-11-17 17:10:08 +03:00
hasuraVersion : 2 ,
2023-12-23 16:34:03 +03:00
DEV _TOKEN : process . env . DEV _TOKEN ,
2023-11-17 17:10:08 +03:00
} ,
scripts : [ ] ,
2022-12-16 18:52:42 +03:00
webpack : {
2023-04-13 19:18:44 +03:00
jsLoader : isServer => ( {
2022-12-16 18:52:42 +03:00
loader : require . resolve ( 'swc-loader' ) ,
options : {
jsc : {
parser : {
syntax : 'typescript' ,
tsx : true ,
} ,
target : 'es2017' ,
} ,
module : {
type : isServer ? 'commonjs' : 'es6' ,
} ,
} ,
} ) ,
} ,
2022-03-28 12:12:27 +03:00
presets : [
[
'classic' ,
/** @type {import('@docusaurus/preset-classic').Options} */
( {
docs : {
2022-07-20 19:34:24 +03:00
routeBasePath : '/' ,
2022-03-28 12:12:27 +03:00
sidebarPath : require . resolve ( './sidebars.js' ) ,
2024-05-16 19:43:28 +03:00
editUrl : ( { docPath } ) => ` https://github.com/hasura/graphql-engine/edit/master/docs/docs/ ${ docPath } ` ,
docItemComponent : require . resolve ( './src/components/CustomDocItem/index.tsx' ) ,
2022-03-28 12:12:27 +03:00
exclude : [ '**/*.wip' ] ,
breadcrumbs : true ,
// showLastUpdateAuthor: true,
// showLastUpdateTime: true,
2022-07-20 19:34:24 +03:00
lastVersion : 'current' ,
2022-03-28 12:12:27 +03:00
versions : {
current : {
2022-07-20 19:34:24 +03:00
label : 'v2.x' ,
2022-03-28 12:12:27 +03:00
badge : true ,
2024-08-15 17:17:28 +03:00
//path: 'latest',
2022-03-28 12:12:27 +03:00
} ,
2022-07-20 19:34:24 +03:00
} ,
2022-03-28 12:12:27 +03:00
} ,
theme : {
customCss : require . resolve ( './src/css/custom.scss' ) ,
} ,
} ) ,
] ,
] ,
plugins : [
'docusaurus-plugin-sass' ,
[
'content-docs' ,
/** @type {import('@docusaurus/plugin-content-docs').Options} */
( {
id : 'wiki' ,
path : 'wiki' ,
2022-07-20 19:34:24 +03:00
routeBasePath : 'wiki' ,
2024-05-16 19:43:28 +03:00
editUrl : ( { docPath } ) => ` https://github.com/hasura/graphql-engine/edit/master/docs/docs/ ${ docPath } ` ,
2022-03-28 12:12:27 +03:00
editCurrentVersion : true ,
2024-05-16 19:43:28 +03:00
docItemComponent : require . resolve ( './src/components/CustomDocItem/CustomDocItemWiki.tsx' ) ,
2022-03-28 12:12:27 +03:00
// disableVersioning: true,
breadcrumbs : false ,
sidebarPath : require . resolve ( './sidebarsWiki.js' ) ,
showLastUpdateAuthor : true ,
showLastUpdateTime : true ,
} ) ,
] ,
[
2024-05-16 19:43:28 +03:00
path . resolve ( _ _dirname , './src/plugins/docusaurus-plugin-segment-analytics' ) ,
2022-03-28 12:12:27 +03:00
{
prodKey : 'RQXoHRpNcmBKllUDihjDjupGv4AHn5TB' ,
devKey : 'FRKElp5cyMax6GAdM8OVyNMIFVppgEgp' ,
// boolean (defaults to false) on whether you want
// to include analytics.page() automatically
trackPage : true ,
// number (defaults to 50); time to wait after a route update before it should
// track the page change, to implement this, make sure your `trackPage` property is set to `true`
// trackPageDelay: 50,
2022-07-20 19:34:24 +03:00
} ,
2022-03-28 12:12:27 +03:00
] ,
[
path . resolve ( _ _dirname , './src/plugins/docusaurus-plugin-google-gtm' ) ,
{
2022-07-20 19:34:24 +03:00
trackingID : 'GTM-PF5MQ2Z' ,
} ,
2022-03-28 12:12:27 +03:00
] ,
] ,
themeConfig :
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
( {
2022-11-18 19:00:57 +03:00
docs : {
sidebar : {
hideable : true ,
2023-04-13 19:18:44 +03:00
autoCollapseCategories : true ,
} ,
2022-11-18 19:00:57 +03:00
} ,
2022-03-28 12:12:27 +03:00
colorMode : {
defaultMode : 'light' ,
disableSwitch : false ,
respectPrefersColorScheme : true ,
} ,
2024-05-16 19:43:28 +03:00
image : 'https://graphql-engine-cdn.hasura.io/assets/hge-docs/og-image.png' ,
2022-03-28 12:12:27 +03:00
prism : {
theme : lightCodeTheme ,
darkTheme : darkCodeTheme ,
2024-05-16 19:43:28 +03:00
additionalLanguages : [ 'rest' , 'http' , 'haskell' , 'plsql' , 'docker' , 'nginx' , 'markdown' ] ,
2022-03-28 12:12:27 +03:00
} ,
algolia : {
// If Algolia did not provide you any appId, use 'BH4D9OD16A'
appId : 'NS6GBGYACO' ,
// Public API key: it is safe to commit it
apiKey : '8f0f11e3241b59574c5dd32af09acdc8' ,
indexName : 'hasura-graphql' ,
// Optional: see doc section below
// contextualSearch: true,
// Optional: Specify domains where the navigation should occur through window.location instead on history.push. Useful when our Algolia config crawls multiple documentation sites and we want to navigate with window.location.href to them.
// externalUrlRegex: 'external\\.com|domain\\.com',
// Optional: Algolia search parameters
// searchParameters: {},
} ,
2024-04-08 16:03:19 +03:00
announcementBar : {
id : 'announcementBar-1' , // Increment on change
2024-07-19 16:25:21 +03:00
content : ` The new version of Hasura has launched. <a target="_blank" rel="noopener noreferrer" href="https://hasura.io/docs/3.0/index/">Check out the Hasura DDN docs here.</a> ` ,
2024-04-08 16:03:19 +03:00
// isCloseable: true,
// backgroundColor: '#fafbfc',
// textColor: '#091E42',
} ,
2022-07-20 19:34:24 +03:00
// announcementBar: {
// id: 'announcement-bar-3',
// content:
// '<a target="_blank" rel="noopener noreferrer" href="https://hasura.io/events/hasura-con-2022/">Check out the product announcements from HasuraCon’ 22</a>',
// backgroundColor: '#511AAA',
// textColor: '#fff',
// },
2022-03-28 12:12:27 +03:00
navbar : {
hideOnScroll : false ,
title : '' ,
logo : {
alt : 'Hasura Logo' ,
src : '/img/logo.svg' ,
srcDark : '/img/logo-light.svg' ,
2022-07-20 19:34:24 +03:00
href : 'https://hasura.io' ,
2022-03-28 12:12:27 +03:00
} ,
items : [
{
to : 'https://hasura.io/products/' ,
label : 'Product' ,
position : 'left' ,
} ,
{
to : 'https://hasura.io/blog/' ,
label : 'Blog' ,
position : 'left' ,
} ,
{
to : 'https://hasura.io/learn/' ,
label : 'Tutorials' ,
position : 'left' ,
} ,
2022-09-13 23:21:57 +03:00
{
to : 'https://hasura.io/changelog' ,
label : "What's New" ,
2023-05-03 23:48:41 +03:00
id : 'whats-new-link' ,
2022-09-13 23:21:57 +03:00
position : 'left' ,
} ,
2023-04-13 19:18:44 +03:00
{
to : '/latest/hasura-cloud/overview' ,
label : 'Hasura Cloud' ,
className : 'header-hasura-cloud-link' ,
position : 'left' ,
} ,
{
to : '/latest/enterprise/overview' ,
label : 'Hasura Enterprise' ,
className : 'header-hasura-ee-link' ,
position : 'left' ,
} ,
2022-03-28 12:12:27 +03:00
{
type : 'docsVersionDropdown' ,
position : 'right' ,
dropdownActiveClassDisabled : true ,
dropdownItemsAfter : [
2024-04-02 22:43:19 +03:00
{
href : 'https://hasura.io/docs/3.0/index/' ,
label : 'v3.x' ,
} ,
2022-03-28 12:12:27 +03:00
{
href : 'https://hasura.io/docs/1.0/graphql/core/index.html' ,
label : 'v1.x' ,
} ,
] ,
} ,
{
type : 'search' ,
position : 'right' ,
} ,
{
href : 'https://github.com/hasura/graphql-engine' ,
position : 'right' ,
className : 'header-github-link' ,
'aria-label' : 'GitHub repository' ,
} ,
{
to : 'https://hasura.io/pricing/' ,
label : 'Pricing' ,
position : 'right' ,
} ,
{
to : 'https://cloud.hasura.io/login?pg=docs&plcmt=header&cta=log-in&tech=default' ,
label : 'Login' ,
position : 'right' ,
2022-07-20 19:34:24 +03:00
className : 'nav-link_login' ,
2022-03-28 12:12:27 +03:00
} ,
{
2023-10-27 11:57:34 +03:00
to : 'https://cloud.hasura.io/signup?pg=products&plcmt=header&cta=get_started&tech=default' ,
2022-03-28 12:12:27 +03:00
label : 'Get Started' ,
position : 'right' ,
2022-07-20 19:34:24 +03:00
className : 'nav-link_getting-started' ,
2022-03-28 12:12:27 +03:00
} ,
] ,
} ,
} ) ,
} ;
module . exports = config ;