diff --git a/.prettierignore b/.prettierignore index 67f4fd81..da9264ac 100644 --- a/.prettierignore +++ b/.prettierignore @@ -5,6 +5,9 @@ node_modules/ # Generated data deno/ +# Versioned json +website/versioned_sidebars/ website/versioned_docs/ +website/versions.json website/.docusaurus/ website/build diff --git a/website/.prettierignore b/website/.prettierignore index 16d5a0db..62505e08 100644 --- a/website/.prettierignore +++ b/website/.prettierignore @@ -3,3 +3,8 @@ node_modules/ # Generated data .docusaurus/ + +# Versioned json +versioned_sidebars/ +versioned_docs/ +versions.json diff --git a/website/docs/Introduction.mdx b/website/docs/Introduction.mdx index 5a90ed79..602b5147 100644 --- a/website/docs/Introduction.mdx +++ b/website/docs/Introduction.mdx @@ -42,7 +42,7 @@ the `*` represents the API version. Below are some examples -```javascript +```typescript showLineNumbers /** * @type {import('discord-api-types/v10').APIUser} */ @@ -52,7 +52,7 @@ the `*` represents the API version. Below are some examples -```javascript +```typescript showLineNumbers /** * @type {import('discord-api-types/v10').APIUser} */ @@ -62,7 +62,7 @@ the `*` represents the API version. Below are some examples -```typescript +```typescript showLineNumbers import { type APIUser } from 'discord-api-types/v10'; ``` @@ -95,7 +95,7 @@ import them: -```typescript +```typescript showLineNumbers // Importing a specific API version import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/deno/v10.ts'; ``` @@ -104,7 +104,7 @@ import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api -```typescript +```typescript showLineNumbers // Importing a specific API version import { APIUser } from 'https://deno.land/x/discord_api_types/v10.ts'; ``` @@ -113,7 +113,7 @@ import { APIUser } from 'https://deno.land/x/discord_api_types/v10.ts'; -```typescript +```typescript showLineNumbers // Importing a specific API version import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v10?dts'; ``` diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 3369cda1..9b54984a 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -166,11 +166,10 @@ const config = { { property: 'og:url', content: BaseUrl } ], navbar: { - title: 'discord-api-types', items: [ { to: '/', - label: 'Home', + label: 'discord-api-types', position: 'left', activeBaseRegex: '^/$' }, diff --git a/website/package-lock.json b/website/package-lock.json index f5da9a3c..5ed68db4 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -7,6 +7,7 @@ "": { "name": "discord-api-types-website", "version": "1.0.0", + "hasInstallScript": true, "license": "MIT", "dependencies": { "@docusaurus/core": "2.0.0-beta.20", diff --git a/website/patches/@sapphire+docusaurus-plugin-ts2esm2cjs+1.1.0.patch b/website/patches/@sapphire+docusaurus-plugin-ts2esm2cjs+1.1.0.patch deleted file mode 100644 index d6d2ed96..00000000 --- a/website/patches/@sapphire+docusaurus-plugin-ts2esm2cjs+1.1.0.patch +++ /dev/null @@ -1,62 +0,0 @@ -diff --git a/node_modules/@sapphire/docusaurus-plugin-ts2esm2cjs/dist/index.js b/node_modules/@sapphire/docusaurus-plugin-ts2esm2cjs/dist/index.js -index fa63a72..ecab1c5 100644 ---- a/node_modules/@sapphire/docusaurus-plugin-ts2esm2cjs/dist/index.js -+++ b/node_modules/@sapphire/docusaurus-plugin-ts2esm2cjs/dist/index.js -@@ -74,7 +74,7 @@ var transformNode = (node, options) => { - { - type: node.type, - lang: node.lang, -- meta: `${jsHighlight} showLineNumbers`, -+ meta: `${jsHighlight}`, - value: prettierFormatCode(restoreNewLines(cjsCode), options.prettierOptions) - }, - { -@@ -84,7 +84,7 @@ var transformNode = (node, options) => { - { - type: node.type, - lang: node.lang, -- meta: `${jsHighlight} showLineNumbers`, -+ meta: `${jsHighlight}`, - value: prettierFormatCode(restoreNewLines(esmCode), options.prettierOptions) - }, - { -@@ -94,7 +94,7 @@ var transformNode = (node, options) => { - { - type: node.type, - lang: node.lang, -- meta: `${tsHighlight} showLineNumbers`, -+ meta: `${tsHighlight}`, - value: node.value - }, - { -diff --git a/node_modules/@sapphire/docusaurus-plugin-ts2esm2cjs/dist/index.mjs b/node_modules/@sapphire/docusaurus-plugin-ts2esm2cjs/dist/index.mjs -index b7c3523..506c78b 100644 ---- a/node_modules/@sapphire/docusaurus-plugin-ts2esm2cjs/dist/index.mjs -+++ b/node_modules/@sapphire/docusaurus-plugin-ts2esm2cjs/dist/index.mjs -@@ -48,7 +48,7 @@ var transformNode = (node, options) => { - { - type: node.type, - lang: node.lang, -- meta: `${jsHighlight} showLineNumbers`, -+ meta: `${jsHighlight}`, - value: prettierFormatCode(restoreNewLines(cjsCode), options.prettierOptions) - }, - { -@@ -58,7 +58,7 @@ var transformNode = (node, options) => { - { - type: node.type, - lang: node.lang, -- meta: `${jsHighlight} showLineNumbers`, -+ meta: `${jsHighlight}`, - value: prettierFormatCode(restoreNewLines(esmCode), options.prettierOptions) - }, - { -@@ -68,7 +68,7 @@ var transformNode = (node, options) => { - { - type: node.type, - lang: node.lang, -- meta: `${tsHighlight} showLineNumbers`, -+ meta: `${tsHighlight}`, - value: node.value - }, - { diff --git a/website/src/css/custom.scss b/website/src/css/custom.scss index 0aecc9f1..18a13b4a 100644 --- a/website/src/css/custom.scss +++ b/website/src/css/custom.scss @@ -16,9 +16,14 @@ --ifm-link-color: hsl(235, 85%, 65%); --ifm-footer-link-color: hsl(235, 85%, 82%); --ifm-navbar-background-color: #4752c4; - --ifm-navbar-link-hover-color: #81d4fa; - --ifm-navbar-link-color: #f5f6f7; --ifm-menu-link-sublist-icon-filter: invert(100%) sepia(94%) saturate(17%) hue-rotate(223deg) brightness(104%) contrast(98%); + --ifm-navbar-height: 64px; + --ifm-navbar-link-color: #e5e7eb; + --ifm-link-hover-color: #e5e7eb; + --ifm-link-color: #e5e7eb; + --ifm-navbar-link-active-color: #e5e7eb; + --ifm-navbar-link-hover-color: #e5e7eb; + --ifm-font-weight-semibold: 700; @media screen and (max-width: 997px) { --ifm-menu-color: var(--ifm-navbar-link-color); @@ -54,25 +59,6 @@ html[data-theme='dark'] .docusaurus-highlight-code-line { background-color: rgba(0, 0, 0, 0.3); } -.prism-code.language-typescript, -.prism-code.language-javascript { - counter-reset: line-number; -} - -.prism-code.language-typescript .token-line::marker, -.prism-code.language-javascript .token-line::marker { - color: var(--ifm-color-gray-700); - content: counter(line-number); -} - -.prism-code.language-typescript .token-line, -.prism-code.language-javascript .token-line { - counter-increment: line-number; - display: list-item; - padding-left: var(--ifm-pre-padding); - margin-left: var(--ifm-global-spacing); -} - .footer--dark { --tw-text-opacity: 1; --ifm-footer-color: rgba(229, 231, 235, var(--tw-text-opacity)); @@ -116,13 +102,46 @@ footer > .container { margin-top: -25%; } +.navbar__link { + line-height: 1.25rem; + display: inline-flex; + align-items: center; +} + +.dropdown { + line-height: 1.25rem; + display: inline-flex; + font-size: 14px; + align-items: center; +} + +.navbar__link--active { + background-color: rgba($color: #000000, $alpha: 0.2); + border-radius: 0.375rem; +} + +.navbar__inner { + height: 100%; + padding-left: 1rem; +} + +.navbar__item { + margin-right: 2rem; + font-size: 14px; + height: 100%; + align-items: center; + border-radius: 0.375rem; +} + +.navbar__item:hover { + background-color: rgba($color: #000000, $alpha: 0.3); + border-radius: 0.375rem; +} + // Inspired from docusaurus - see THIRD_PARTY_LICENSE.md .header-github-link { position: relative; -} - -.header-github-link:hover { - opacity: 0.6; + padding-left: 2.5rem; } .header-github-link::before { @@ -133,21 +152,24 @@ footer > .container { background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='white' d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E") no-repeat; position: absolute; - left: -1.5rem; + left: 0.5rem; margin-right: 2rem; } +@media (max-width: 1500px) { + .navbar__item { + margin-right: 1rem; + } +} + @media (max-width: 996px) { // Hide navbar branding .navbar__brand { display: none; } - .header-github-link { - padding-left: 2.5rem; - - &::before { - left: 0.5rem; - } + // Hide navigation items when in mobile view + .navbar__item { + display: none; } } diff --git a/website/src/css/discordjs.scss b/website/src/css/discordjs.scss index 2cb96593..0726b216 100644 --- a/website/src/css/discordjs.scss +++ b/website/src/css/discordjs.scss @@ -39,7 +39,8 @@ color: #f5f6f7; > :first-child:hover { - background: var(--ifm-color-gray-800); + background-color: rgba($color: #000000, $alpha: 0.3); + border-radius: 0.375rem; } } diff --git a/website/versioned_docs/version-0.33.0/Introduction.mdx b/website/versioned_docs/version-0.33.0/Introduction.mdx index a5c4a991..b830b100 100644 --- a/website/versioned_docs/version-0.33.0/Introduction.mdx +++ b/website/versioned_docs/version-0.33.0/Introduction.mdx @@ -42,7 +42,7 @@ the `*` represents the API version. Below are some examples -```javascript +```javascript showLineNumbers /** * @type {import('discord-api-types/v10').APIUser} */ @@ -52,7 +52,7 @@ the `*` represents the API version. Below are some examples -```javascript +```javascript showLineNumbers /** * @type {import('discord-api-types/v10').APIUser} */ @@ -62,7 +62,7 @@ the `*` represents the API version. Below are some examples -```typescript +```typescript showLineNumbers import { type APIUser } from 'discord-api-types/v10'; ``` @@ -95,7 +95,7 @@ import them: -```typescript +```typescript showLineNumbers // Importing a specific API version import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/deno/v10.ts'; ``` @@ -104,7 +104,7 @@ import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api -```typescript +```typescript showLineNumbers // Importing a specific API version import { APIUser } from 'https://deno.land/x/discord_api_types/v10.ts'; ``` @@ -113,7 +113,7 @@ import { APIUser } from 'https://deno.land/x/discord_api_types/v10.ts'; -```typescript +```typescript showLineNumbers // Importing a specific API version import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v10?dts'; ``` diff --git a/website/versioned_docs/version-0.33.1/Introduction.mdx b/website/versioned_docs/version-0.33.1/Introduction.mdx index 5a90ed79..ec8f9f48 100644 --- a/website/versioned_docs/version-0.33.1/Introduction.mdx +++ b/website/versioned_docs/version-0.33.1/Introduction.mdx @@ -42,7 +42,7 @@ the `*` represents the API version. Below are some examples -```javascript +```javascript showLineNumbers /** * @type {import('discord-api-types/v10').APIUser} */ @@ -52,7 +52,7 @@ the `*` represents the API version. Below are some examples -```javascript +```javascript showLineNumbers /** * @type {import('discord-api-types/v10').APIUser} */ @@ -62,7 +62,7 @@ the `*` represents the API version. Below are some examples -```typescript +```typescript showLineNumbers import { type APIUser } from 'discord-api-types/v10'; ``` @@ -95,7 +95,7 @@ import them: -```typescript +```typescript showLineNumbers // Importing a specific API version import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/deno/v10.ts'; ``` @@ -104,7 +104,7 @@ import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api -```typescript +```typescript showLineNumbers // Importing a specific API version import { APIUser } from 'https://deno.land/x/discord_api_types/v10.ts'; ``` @@ -113,7 +113,7 @@ import { APIUser } from 'https://deno.land/x/discord_api_types/v10.ts'; -```typescript +```typescript showLineNumbers // Importing a specific API version import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v10?dts'; ```