diff --git a/docs/README.md b/docs/README.md index b7c72a3a7..671cae9fd 100644 --- a/docs/README.md +++ b/docs/README.md @@ -20,7 +20,9 @@ docs/ │ └── oslo.svg ├── src/ │ └── theme (only contains the 404 page) -├── docusaurus.config.js (main config file. also where to set navbar/footer) +├── docusaurus.config.js (main config file) +├── footerConfig.js (footer. go to main repo to change) +├── navbarConfig.js (navbar. go to main repo to change) ├── sidebar.js (manually set where the content docs are in the sidebar.) └── typedoc.json (typedoc parameters for generating reference from src) ``` diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 33dce351f..2e9e9e8bb 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -1,10 +1,6 @@ -// @ts-check -// `@type` JSDoc annotations allow editor autocompletion and type checking -// (when paired with `@ts-check`). -// There are various equivalent ways to declare your Docusaurus config. -// See: https://docusaurus.io/docs/api/docusaurus-config - -import {themes as prismThemes} from 'prism-react-renderer'; +import { themes as prismThemes } from 'prism-react-renderer'; +const footer = require('./footerConfig'); +const navbar = require('./navbarConfig'); /** @type {import('@docusaurus/types').Config} */ const config = { @@ -42,17 +38,15 @@ const config = { theme: { customCss: './src/css/custom.css', }, - gtag: { - trackingID: 'G-9H1YZW28BG', - }, }), ], ], - plugins: - ['docusaurus-theme-github-codeblock', + plugins: [ + 'docusaurus-theme-github-codeblock', - ['@docusaurus/plugin-client-redirects', + [ + '@docusaurus/plugin-client-redirects', { redirects: [ { @@ -76,8 +70,8 @@ const config = { id: 'cli-test', entryPoints: ['../packages/cli-test/src/index.ts'], tsconfig: '../packages/cli-test/tsconfig.json', - out: "./content/reference/cli-test", - } + out: './content/reference/cli-test', + }, ], [ 'docusaurus-plugin-typedoc', @@ -85,8 +79,8 @@ const config = { id: 'events-api', entryPoints: ['../packages/events-api/src/index.ts'], tsconfig: '../packages/events-api/tsconfig.json', - out: "./content/reference/events-api", - } + out: './content/reference/events-api', + }, ], [ 'docusaurus-plugin-typedoc', @@ -94,8 +88,8 @@ const config = { id: 'interactive-messages', entryPoints: ['../packages/interactive-messages/src/index.ts'], tsconfig: '../packages/interactive-messages/tsconfig.json', - out: "./content/reference/interactive-messages", - } + out: './content/reference/interactive-messages', + }, ], [ 'docusaurus-plugin-typedoc', @@ -103,8 +97,8 @@ const config = { id: 'logger', entryPoints: ['../packages/logger/src/index.ts'], tsconfig: '../packages/logger/tsconfig.json', - out: "./content/reference/logger", - } + out: './content/reference/logger', + }, ], [ 'docusaurus-plugin-typedoc', @@ -112,8 +106,8 @@ const config = { id: 'oauth', entryPoints: ['../packages/oauth/src/index.ts'], tsconfig: '../packages/oauth/tsconfig.json', - out: "./content/reference/oauth", - } + out: './content/reference/oauth', + }, ], [ 'docusaurus-plugin-typedoc', @@ -121,8 +115,8 @@ const config = { id: 'rtm-api', entryPoints: ['../packages/rtm-api/src/index.ts'], tsconfig: '../packages/rtm-api/tsconfig.json', - out: "./content/reference/rtm-api", - } + out: './content/reference/rtm-api', + }, ], [ 'docusaurus-plugin-typedoc', @@ -130,8 +124,8 @@ const config = { id: 'socket-mode', entryPoints: ['../packages/socket-mode/src/index.ts'], tsconfig: '../packages/socket-mode/tsconfig.json', - out: "./content/reference/socket-mode", - } + out: './content/reference/socket-mode', + }, ], [ 'docusaurus-plugin-typedoc', @@ -139,8 +133,8 @@ const config = { id: 'types', entryPoints: ['../packages/types/src/index.ts'], tsconfig: '../packages/types/tsconfig.json', - out: "./content/reference/types", - } + out: './content/reference/types', + }, ], [ 'docusaurus-plugin-typedoc', @@ -148,8 +142,8 @@ const config = { id: 'web', entryPoints: ['../packages/web-api/src/index.ts'], tsconfig: '../packages/web-api/tsconfig.json', - out: "./content/reference/web-api", - } + out: './content/reference/web-api', + }, ], [ 'docusaurus-plugin-typedoc', @@ -157,9 +151,9 @@ const config = { id: 'webhook', entryPoints: ['../packages/webhook/src/index.ts'], tsconfig: '../packages/webhook/tsconfig.json', - out: "./content/reference/webhook", - } - ] + out: './content/reference/webhook', + }, + ], ], themeConfig: @@ -173,107 +167,17 @@ const config = { autoCollapseCategories: true, }, }, - navbar: { - title: "Slack Developer Tools", - logo: { - alt: 'Slack logo', - src: 'img/slack-logo.svg', - href: 'https://tools.slack.dev', - target : '_self' - }, - items: [ - { - type: 'dropdown', - label: 'Bolt', - position: 'left', - items: [ - { - label: 'Java', - to: 'https://tools.slack.dev/java-slack-sdk/guides/bolt-basics', - target: '_self', - }, - { - label: 'JavaScript', - to: 'https://tools.slack.dev/bolt-js', - target: '_self', - }, - { - label: 'Python', - to: 'https://tools.slack.dev/bolt-python', - target: '_self', - }, - ] - }, - { - type: 'dropdown', - label: 'SDKs', - position: 'left', - items: [ - { - label: 'Java Slack SDK', - to: 'https://tools.slack.dev/java-slack-sdk/', - target: '_self', - }, - { - label: 'Node Slack SDK', - to: 'https://tools.slack.dev/node-slack-sdk/', - target: '_self', - }, - { - label: 'Python Slack SDK', - to: 'https://tools.slack.dev/python-slack-sdk/', - target: '_self', - }, - { - label: 'Deno Slack SDK', - to: 'https://api.slack.com/automation/quickstart', - target: '_self', - }, - ] - }, - { - type: 'dropdown', - label: 'Community', - position: 'left', - items: [ - { - label: 'Community tools', - to: 'https://tools.slack.dev/community-tools', - target: '_self', - }, - { - label: 'Slack Community', - to: 'https://slackcommunity.com/', - target: '_self', - }, - ] - }, - { - to: 'https://api.slack.com/docs', - label: 'API Docs', - target: '_self', - }, - { - 'aria-label': 'GitHub Repository', - 'className': 'navbar-github-link', - 'href': 'https://github.com/slackapi/node-slack-sdk', - 'position': 'right', - target: '_self', - }, - ], - }, - footer: { - copyright: `
Made with ♡ by Slack and pals like you
`, - }, + navbar, + footer, prism: { // switch to alucard when available in prism? - theme: prismThemes.github, + theme: prismThemes.github, darkTheme: prismThemes.dracula, }, - codeblock: { - showGithubLink: true, - githubLinkLabel: 'View on GitHub', - }, + codeblock: { + showGithubLink: true, + githubLinkLabel: 'View on GitHub', + }, // announcementBar: { // id: `announcementBar`, // content: `🎉️ Version 2.26.0 of the developer tools for the Slack automations platform is here! 🎉️ `, diff --git a/docs/footerConfig.js b/docs/footerConfig.js new file mode 100644 index 000000000..e3e10c571 --- /dev/null +++ b/docs/footerConfig.js @@ -0,0 +1,19 @@ +const footer = { + links: [ + { + items: [ + { + html: ` +
+ ©2024 Slack Technologies, LLC, a Salesforce company. All rights reserved. Various trademarks held by their respective owners. + `, + }, + ], + }, + ], +}; + +module.exports = footer; diff --git a/docs/navbarConfig.js b/docs/navbarConfig.js new file mode 100644 index 000000000..f4277367a --- /dev/null +++ b/docs/navbarConfig.js @@ -0,0 +1,88 @@ +const navbar = { + title: 'Slack Developer Tools', + logo: { + src: 'img/slack-logo.svg', + }, + items: [ + { + type: 'dropdown', + label: 'Bolt', + position: 'left', + items: [ + { + label: 'Java', + to: 'https://tools.slack.dev/java-slack-sdk/guides/bolt-basics', + target: '_self', + }, + { + label: 'JavaScript', + to: 'https://tools.slack.dev/bolt-js', + target: '_self', + }, + { + label: 'Python', + to: 'https://tools.slack.dev/bolt-python', + target: '_self', + }, + ], + }, + { + type: 'dropdown', + label: 'SDKs', + position: 'left', + items: [ + { + label: 'Java Slack SDK', + to: 'https://tools.slack.dev/java-slack-sdk/', + target: '_self', + }, + { + label: 'Node Slack SDK', + to: 'https://tools.slack.dev/node-slack-sdk/', + target: '_self', + }, + { + label: 'Python Slack SDK', + to: 'https://tools.slack.dev/python-slack-sdk/', + target: '_self', + }, + { + label: 'Deno Slack SDK', + to: 'https://api.slack.com/automation/quickstart', + target: '_self', + }, + ], + }, + { + type: 'dropdown', + label: 'Community', + position: 'left', + items: [ + { + label: 'Community tools', + to: 'https://tools.slack.dev/community-tools', + target: '_self', + }, + { + label: 'Slack Community', + to: 'https://slackcommunity.com/', + target: '_self', + }, + ], + }, + { + to: 'https://api.slack.com/docs', + label: 'API Docs', + target: '_self', + }, + { + 'aria-label': 'GitHub Repository', + className: 'navbar-github-link', + href: 'https://github.com/slackapi', + position: 'right', + target: '_self', + }, + ], +}; + +module.exports = navbar;