From 9008f19f761373be3b313b2cffa936310aeffdc0 Mon Sep 17 00:00:00 2001 From: Gabriel Le Breton Date: Wed, 18 May 2022 14:44:04 -0400 Subject: [PATCH 1/5] Move theme to own file --- docusaurus.config.js | 80 +------------------------------- src/dracula-custom-code-theme.js | 79 +++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 79 deletions(-) create mode 100644 src/dracula-custom-code-theme.js diff --git a/docusaurus.config.js b/docusaurus.config.js index 3b77fa9b..0c5b42dd 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -5,85 +5,7 @@ const lightCodeTheme = require('prism-react-renderer/themes/github'); -const darkCodeTheme = { - plain: { - color: '#F8F8F2', - backgroundColor: '#282A36', - }, - styles: [ - { - types: ['comment', 'prolog', 'doctype', 'cdata'], - style: { - color: 'rgb(98, 114, 164)', - }, - }, - { - types: ['namespace'], - style: { - opacity: 0.7, - }, - }, - { - types: ['string', 'attr-value'], - style: { - color: 'rgb(241, 250, 140)', - }, - }, - { - types: ['punctuation', 'operator'], - style: { - color: 'rgb(248, 248, 242)', - }, - }, - { - types: [ - 'entity', - 'url', - 'symbol', - 'number', - 'boolean', - 'variable', - 'constant', - 'property', - 'regex', - 'inserted', - ], - style: { - color: 'rgb(189, 147, 249)', - }, - }, - { - types: ['atrule', 'function'], - style: { - color: 'rgb(139, 233, 253)', - }, - }, - { - types: ['keyword', 'attr-name', 'selector'], - style: { - color: 'rgb(255, 121, 198)', - }, - }, - { - types: ['deleted', 'tag'], - style: { - color: 'rgb(255, 85, 85)', - }, - }, - { - types: ['function-variable'], - style: { - color: 'rgb(255, 184, 108)', - }, - }, - { - types: ['tag', 'selector', 'keyword'], - style: { - color: 'rgb(80, 250, 123)', - }, - }, - ], -}; +const darkCodeTheme = require('./src/dracula-custom-code-theme'); /** @type {import('@docusaurus/types').Config} */ const config = { diff --git a/src/dracula-custom-code-theme.js b/src/dracula-custom-code-theme.js new file mode 100644 index 00000000..bb7440dc --- /dev/null +++ b/src/dracula-custom-code-theme.js @@ -0,0 +1,79 @@ +module.exports = { + plain: { + color: '#F8F8F2', + backgroundColor: '#282A36', + }, + styles: [ + { + types: ['comment', 'prolog', 'doctype', 'cdata'], + style: { + color: 'rgb(98, 114, 164)', + }, + }, + { + types: ['namespace'], + style: { + opacity: 0.7, + }, + }, + { + types: ['string', 'attr-value'], + style: { + color: 'rgb(241, 250, 140)', + }, + }, + { + types: ['punctuation', 'operator'], + style: { + color: 'rgb(248, 248, 242)', + }, + }, + { + types: [ + 'entity', + 'url', + 'symbol', + 'number', + 'boolean', + 'variable', + 'constant', + 'property', + 'regex', + 'inserted', + ], + style: { + color: 'rgb(189, 147, 249)', + }, + }, + { + types: ['atrule', 'function'], + style: { + color: 'rgb(139, 233, 253)', + }, + }, + { + types: ['keyword', 'attr-name', 'selector'], + style: { + color: 'rgb(255, 121, 198)', + }, + }, + { + types: ['deleted', 'tag'], + style: { + color: 'rgb(255, 85, 85)', + }, + }, + { + types: ['function-variable'], + style: { + color: 'rgb(255, 184, 108)', + }, + }, + { + types: ['tag', 'selector', 'keyword'], + style: { + color: 'rgb(80, 250, 123)', + }, + }, + ], +}; From f838e58c54761781a65f2270a113cee7850eae31 Mon Sep 17 00:00:00 2001 From: Gabriel Le Breton Date: Wed, 18 May 2022 14:44:54 -0400 Subject: [PATCH 2/5] Update algolia appId and apiKey to use docsearch --- docusaurus.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docusaurus.config.js b/docusaurus.config.js index 0c5b42dd..0330ec0d 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -75,10 +75,10 @@ const config = { }, algolia: { // The application ID provided by Algolia - appId: 'BH4D9OD16A', + appId: 'E57FOT37U9', // Public API key: it is safe to commit it - apiKey: 'd085b783b0341babb98dc7fdc6a2a8be', + apiKey: '1df02f65283b9c1c95637a3a0d8a024a', indexName: 'game', From 24efdb4576e3281d94386e2c94ac281a8161e28a Mon Sep 17 00:00:00 2001 From: Gabriel Le Breton Date: Wed, 18 May 2022 16:29:22 -0400 Subject: [PATCH 3/5] Disabling contextualSearch to demonstrate that keys are ok --- docusaurus.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docusaurus.config.js b/docusaurus.config.js index 0330ec0d..e021168d 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -83,7 +83,7 @@ const config = { indexName: 'game', // Optional: see doc section below - contextualSearch: true, + contextualSearch: false, // 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', From 82dde7aae7ce29a80300a462eedc14d4318d9421 Mon Sep 17 00:00:00 2001 From: Gabriel Le Breton Date: Wed, 18 May 2022 16:48:21 -0400 Subject: [PATCH 4/5] Revert "Disabling contextualSearch to demonstrate that keys are ok" This reverts commit 24efdb4576e3281d94386e2c94ac281a8161e28a. --- docusaurus.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docusaurus.config.js b/docusaurus.config.js index e021168d..0330ec0d 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -83,7 +83,7 @@ const config = { indexName: 'game', // Optional: see doc section below - contextualSearch: false, + 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', From 1668b1ce3318c1870b991ffbc5978c94e98adaee Mon Sep 17 00:00:00 2001 From: Gabriel Le Breton Date: Wed, 18 May 2022 17:09:36 -0400 Subject: [PATCH 5/5] Update theme to match default yaml just like in IntelliJ <3 --- docusaurus.config.js | 1 - src/dracula-custom-code-theme.js | 8 +------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/docusaurus.config.js b/docusaurus.config.js index 0330ec0d..e3e33e57 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -4,7 +4,6 @@ // Note: type annotations allow type checking and IDEs autocompletion const lightCodeTheme = require('prism-react-renderer/themes/github'); - const darkCodeTheme = require('./src/dracula-custom-code-theme'); /** @type {import('@docusaurus/types').Config} */ diff --git a/src/dracula-custom-code-theme.js b/src/dracula-custom-code-theme.js index bb7440dc..4c4baceb 100644 --- a/src/dracula-custom-code-theme.js +++ b/src/dracula-custom-code-theme.js @@ -22,12 +22,6 @@ module.exports = { color: 'rgb(241, 250, 140)', }, }, - { - types: ['punctuation', 'operator'], - style: { - color: 'rgb(248, 248, 242)', - }, - }, { types: [ 'entity', @@ -52,7 +46,7 @@ module.exports = { }, }, { - types: ['keyword', 'attr-name', 'selector'], + types: ['punctuation', 'operator', 'keyword', 'attr-name', 'selector'], style: { color: 'rgb(255, 121, 198)', },