diff --git a/.github/workflows/docs-ci.yaml b/.github/workflows/docs-ci.yaml index 4de003a7684..43b98a85c05 100644 --- a/.github/workflows/docs-ci.yaml +++ b/.github/workflows/docs-ci.yaml @@ -48,9 +48,25 @@ jobs: working-directory: docs/site run: npm run typecheck + - name: Egress-check unit tests + working-directory: docs/site + run: npm run test:egress + - name: Build docs site (includes OpenAPI prebuild) working-directory: docs/site run: npm run build env: ALGOLIA_APP_ID: ${{ vars.ALGOLIA_APP_ID }} ALGOLIA_SEARCH_API_KEY: ${{ vars.ALGOLIA_SEARCH_API_KEY }} + + # Hosted Algolia injects SearchBar preconnects; do not scan that artifact. + # Rebuild without ALGOLIA_* (prebuild already ran) for the offline shape. + - name: Rebuild without Algolia for egress scan + working-directory: docs/site + run: npx docusaurus build && npm run postbuild + env: + BASE_URL: / + + - name: Scan built site for egress + working-directory: docs/site + run: npm run check:egress diff --git a/docs/develop/contribute/more-info/getting-started/img/gitpod-branch-name.jpeg b/docs/develop/contribute/more-info/getting-started/img/gitpod-branch-name.jpeg new file mode 100644 index 00000000000..e248e96fbeb Binary files /dev/null and b/docs/develop/contribute/more-info/getting-started/img/gitpod-branch-name.jpeg differ diff --git a/docs/develop/contribute/more-info/getting-started/img/gitpod-commit-message.jpeg b/docs/develop/contribute/more-info/getting-started/img/gitpod-commit-message.jpeg new file mode 100644 index 00000000000..e8cab5a3dfe Binary files /dev/null and b/docs/develop/contribute/more-info/getting-started/img/gitpod-commit-message.jpeg differ diff --git a/docs/develop/contribute/more-info/getting-started/img/gitpod-config-repo.jpeg b/docs/develop/contribute/more-info/getting-started/img/gitpod-config-repo.jpeg new file mode 100644 index 00000000000..1c03b9bc85a Binary files /dev/null and b/docs/develop/contribute/more-info/getting-started/img/gitpod-config-repo.jpeg differ diff --git a/docs/develop/contribute/more-info/getting-started/img/gitpod-confirm-perms.jpeg b/docs/develop/contribute/more-info/getting-started/img/gitpod-confirm-perms.jpeg new file mode 100644 index 00000000000..e084e1ce6a9 Binary files /dev/null and b/docs/develop/contribute/more-info/getting-started/img/gitpod-confirm-perms.jpeg differ diff --git a/docs/develop/contribute/more-info/getting-started/img/gitpod-create-pr-on-github.jpeg b/docs/develop/contribute/more-info/getting-started/img/gitpod-create-pr-on-github.jpeg new file mode 100644 index 00000000000..0e096c1404d Binary files /dev/null and b/docs/develop/contribute/more-info/getting-started/img/gitpod-create-pr-on-github.jpeg differ diff --git a/docs/develop/contribute/more-info/getting-started/img/gitpod-intro.jpeg b/docs/develop/contribute/more-info/getting-started/img/gitpod-intro.jpeg new file mode 100644 index 00000000000..4eba1cc1a1e Binary files /dev/null and b/docs/develop/contribute/more-info/getting-started/img/gitpod-intro.jpeg differ diff --git a/docs/develop/contribute/more-info/getting-started/img/gitpod-make-fork.jpeg b/docs/develop/contribute/more-info/getting-started/img/gitpod-make-fork.jpeg new file mode 100644 index 00000000000..3f8b71f381e Binary files /dev/null and b/docs/develop/contribute/more-info/getting-started/img/gitpod-make-fork.jpeg differ diff --git a/docs/develop/contribute/more-info/getting-started/img/gitpod-need-perms.jpeg b/docs/develop/contribute/more-info/getting-started/img/gitpod-need-perms.jpeg new file mode 100644 index 00000000000..8c486edc10f Binary files /dev/null and b/docs/develop/contribute/more-info/getting-started/img/gitpod-need-perms.jpeg differ diff --git a/docs/develop/contribute/more-info/getting-started/img/gitpod-new-branch.jpeg b/docs/develop/contribute/more-info/getting-started/img/gitpod-new-branch.jpeg new file mode 100644 index 00000000000..af107b967c3 Binary files /dev/null and b/docs/develop/contribute/more-info/getting-started/img/gitpod-new-branch.jpeg differ diff --git a/docs/develop/contribute/more-info/getting-started/img/gitpod-open-fork-on-github.jpeg b/docs/develop/contribute/more-info/getting-started/img/gitpod-open-fork-on-github.jpeg new file mode 100644 index 00000000000..765231e7cb0 Binary files /dev/null and b/docs/develop/contribute/more-info/getting-started/img/gitpod-open-fork-on-github.jpeg differ diff --git a/docs/develop/contribute/more-info/getting-started/img/gitpod-open-perms.jpeg b/docs/develop/contribute/more-info/getting-started/img/gitpod-open-perms.jpeg new file mode 100644 index 00000000000..a73849c259e Binary files /dev/null and b/docs/develop/contribute/more-info/getting-started/img/gitpod-open-perms.jpeg differ diff --git a/docs/develop/contribute/more-info/getting-started/img/gitpod-pr-creation-page.jpeg b/docs/develop/contribute/more-info/getting-started/img/gitpod-pr-creation-page.jpeg new file mode 100644 index 00000000000..390251b1c52 Binary files /dev/null and b/docs/develop/contribute/more-info/getting-started/img/gitpod-pr-creation-page.jpeg differ diff --git a/docs/develop/contribute/more-info/getting-started/img/gitpod-real-pr.jpeg b/docs/develop/contribute/more-info/getting-started/img/gitpod-real-pr.jpeg new file mode 100644 index 00000000000..1fcf82be9b7 Binary files /dev/null and b/docs/develop/contribute/more-info/getting-started/img/gitpod-real-pr.jpeg differ diff --git a/docs/develop/contribute/more-info/getting-started/img/gitpod-select-perms.jpeg b/docs/develop/contribute/more-info/getting-started/img/gitpod-select-perms.jpeg new file mode 100644 index 00000000000..f279c278a4c Binary files /dev/null and b/docs/develop/contribute/more-info/getting-started/img/gitpod-select-perms.jpeg differ diff --git a/docs/develop/contribute/more-info/getting-started/img/gitpod-sign-into-github.jpeg b/docs/develop/contribute/more-info/getting-started/img/gitpod-sign-into-github.jpeg new file mode 100644 index 00000000000..547762b47c4 Binary files /dev/null and b/docs/develop/contribute/more-info/getting-started/img/gitpod-sign-into-github.jpeg differ diff --git a/docs/develop/contribute/more-info/getting-started/using-gitpod.md b/docs/develop/contribute/more-info/getting-started/using-gitpod.md index 2422d9a8a4c..65fcab4866d 100644 --- a/docs/develop/contribute/more-info/getting-started/using-gitpod.md +++ b/docs/develop/contribute/more-info/getting-started/using-gitpod.md @@ -11,10 +11,10 @@ sidebar_position: 6 1. Create a new workspace for a ticket/issue that you've claimed by going to the [mattermost-gitpod-config](https://github.com/mattermost/mattermost-gitpod-config/tree/master) repository and clicking the "Open in Gitpod" badge. * You can also use the [Gitpod browser extension](https://www.gitpod.io/docs/configure/user-settings/browser-extension) to open up a repository in Gitpod, or manually prefix GitHub repository URLs with `gitpod.io/#`. What the extension does is add a green Gitpod button to repository pages on GitHub, and clicking it spins up a new environment for the repository on Gitpod. - ![mattermost-gitpod-config-repo](https://user-images.githubusercontent.com/43153413/194467192-675a6b15-bb3b-4a4d-be05-f1df0fbdd524.jpeg) + ![mattermost-gitpod-config-repo](./img/gitpod-config-repo.jpeg) 2. You may need to sign in (through GitHub) to access the workspace on Gitpod. Once Gitpod has done loading, the user interface presented is that of VSCode. -![mattermost-gitpod-intro](https://user-images.githubusercontent.com/43153413/194467255-98b5a9be-85a5-4da8-b519-279011882384.jpeg) +![mattermost-gitpod-intro](./img/gitpod-intro.jpeg) #### :pencil2: Working on an issue/ticket @@ -27,44 +27,44 @@ sidebar_position: 6 5. Click the "Source Control" icon on the left sidebar. On the panel next to the side bar, you will see a list of the repositories in the workspace, and under each repository a list of the files that have changed (if any). Next to the label for `mattermost-webapp`, click the button with the branch name and the source control icon. 6. A dropdown will appear via the command palette. Click the option that says: "+ Create new branch..." -![mattermost-gitpod-new-branch](https://user-images.githubusercontent.com/43153413/194467696-498917fe-14a3-4cbc-ac35-1b201ce3c730.jpeg) +![mattermost-gitpod-new-branch](./img/gitpod-new-branch.jpeg) 7. In the box that appears, name your new branch. A good name idea is to name it after the code that refers to your issue - in this case, this is the "Test Key", so a suitable name for the branch is `MM-T642`. Then, hit `Enter` on your keyboard. -![mattermost-gitpod-branch-name](https://user-images.githubusercontent.com/43153413/194467742-e7312d5d-dbb3-4bcc-a5af-b67941bbf4f2.jpeg) +![mattermost-gitpod-branch-name](./img/gitpod-branch-name.jpeg) 8. Now that the branch has changed, you can commit your changes to it. Back in the source control panel, you can make a commit message in the text box above the "commit button" in the section for the `mattermost-webapp` repository. Then, press the "commit button". A modal may appear asking you to first stage your changes. -![mattermost-gitpod-commit-message](https://user-images.githubusercontent.com/43153413/194467789-0f588a7c-ff8b-4bc9-adaf-5d224726b2a5.jpeg) +![mattermost-gitpod-commit-message](./img/gitpod-commit-message.jpeg) 9. You can now publish your branch to the remote. However, as you will not have access to the main repository itself, you will be prompted to first create a fork. Click on the "publish branch button" on the source control panel. A popup will appear, asking if you would like to make a fork and push to that instead. On the popup, select the "create fork" button. -![mattermost-gitpod-make-fork](https://user-images.githubusercontent.com/43153413/194468420-14564230-fb63-442c-b0e6-815aeb799da5.jpeg) +![mattermost-gitpod-make-fork](./img/gitpod-make-fork.jpeg) 10. During the process of fork creation, you may be prompted to grant GitHub access to Gitpod's GitHub extension (you should allow this). -![mattermost-gitpod-sign-into-GitHub](https://user-images.githubusercontent.com/43153413/194468466-79cf2804-5393-4a1c-994f-9c087ff42b1d.jpeg) +![mattermost-gitpod-sign-into-GitHub](./img/gitpod-sign-into-github.jpeg) 11. You may also be asked to update the permissions you give Gitpod to access GitHub through a popup. If this happens, you will have to restart the fork creation process (publish branch -> say yes to creating a fork). Click the "open access control" button on the popup. -![mattermost-gitpod-need-perms](https://user-images.githubusercontent.com/43153413/194468523-f7c7ce87-3586-48bf-b779-38253de0059e.jpeg) +![mattermost-gitpod-need-perms](./img/gitpod-need-perms.jpeg) 12. You will get taken to the Integration section of Gitpod's settings. In the list of Git Providers on the page, find GitHub, click the three dots next to the listing, and select "Edit Permissions" from the dropdown menu. -![mattermost-gitpod-open-perms](https://user-images.githubusercontent.com/43153413/194468548-7b31a634-dd4a-49bb-a697-a8b3e5aa39db.jpeg) +![mattermost-gitpod-open-perms](./img/gitpod-open-perms.jpeg) 13. A popup will appear with a list of permission checkboxes. It's a good idea to check all of them off so you don't need to go through this process again. When you're done checking off the permissions, click the "Update Permissions" button. -![mattermost-gitpod-select-perms](https://user-images.githubusercontent.com/43153413/194468567-fba1fc58-f4db-4787-8dcd-d594472d7692.jpeg) +![mattermost-gitpod-select-perms](./img/gitpod-select-perms.jpeg) 14. Another tab might also appear where on GitHub's end you accept the additional permissions Gitpod is requesting. Click on the "authorize gitpod-io" button. -![mattermost-gitpod-confirm-perms](https://user-images.githubusercontent.com/43153413/194468598-1866b681-ae3b-42a0-b94c-c02735776e02.jpeg) +![mattermost-gitpod-confirm-perms](./img/gitpod-confirm-perms.jpeg) 15. Once the forking process is done, there will be a couple of popups that appear on Gitpod: one asking if you'd like to periodically run `git fetch` (which will periodically download content from the remote), another one asking if you'd like to create a pull request for the branch you're on right inside Gitpod/the VSCode editor, and finally one informing that the fork was successfully created. On the successful fork creation popup, click the `open on GitHub` option. -![mattermost-gitpod-open-fork-on-GitHub](https://user-images.githubusercontent.com/43153413/194468614-a89701c4-8b09-4b80-b84e-a0beaca8431c.jpeg) +![mattermost-gitpod-open-fork-on-GitHub](./img/gitpod-open-fork-on-github.jpeg) #### :mag: Creating a Pull Request (PR) 16. You'll get taken to GitHub, to the fork of the repository you've worked on in your account instead of the main one in the Mattermost organization. Navigate to the branch you've made on your fork if you're not there already. * Near the top of the page will be a bar mentioning how many commits ahead/behind your branch is from the `master`/`main` branch of the main repository. There will also be two buttons: "contribute" and "sync fork". Click on the "contribute" button, and in the dropdown that appears, click the "open pull request" button. -![mattermost-gitpod-create-PR-on-GitHub](https://user-images.githubusercontent.com/43153413/194468644-8c625663-17d4-4187-92be-171b683d298f.jpeg) +![mattermost-gitpod-create-PR-on-GitHub](./img/gitpod-create-pr-on-github.jpeg) 17. You'll be taken to another page on GitHub called "Open a pull request". -![mattermost-gitpod-PR-creation-page](https://user-images.githubusercontent.com/43153413/194468667-aace5ac5-4bbe-4e93-9902-e210964e00c8.jpeg) +![mattermost-gitpod-PR-creation-page](./img/gitpod-pr-creation-page.jpeg) ```text * The first section of the page compares whether the branches (your branch on your fork - the "head repository" vs. the master/main branch on the main repository - the "base repository") can be merged automatically. @@ -95,7 +95,7 @@ sidebar_position: 6 ``` 18. Once you've created your pull request, you'll get taken to its page, like this one: [MM-T642: Attachment does not collapse - Cypress Webapp E2E Test #11231](https://github.com/mattermost/mattermost/pull/11231). Below your initial body text of the PR will be a list of commits and other comments. At the end of this list is a checklist which notes the status of reviews required for the pull request, and the checks that the pull request must pass, plus a place to write your own additional comments. -![mattermost-gitpod-real-PR-1](https://user-images.githubusercontent.com/43153413/194468726-afddf66f-eaf1-4dab-a6bf-7ddf39db78bf.jpeg) +![mattermost-gitpod-real-PR-1](./img/gitpod-real-pr.jpeg) 19. if you need to make any changes to your PR, you can return to Gitpod and stage and commit your changes from there onto your branch; and this will be reflected in GitHub. diff --git a/docs/develop/integrate/plugins/developer-workflow.md b/docs/develop/integrate/plugins/developer-workflow.md index 9a23bb82228..2fd68857bf4 100644 --- a/docs/develop/integrate/plugins/developer-workflow.md +++ b/docs/develop/integrate/plugins/developer-workflow.md @@ -146,9 +146,9 @@ This starts a headless `delve` process for your IDE to connect to. The process l Run the debugger in VSCode by navigating to the "Run and Debug" tab on the left side of the IDE, selecting your launch configuration, and clicking the green play button. This should bring up a debugging widget that looks like this: -![image](https://github.com/mattermost/mattermost-developer-documentation/assets/6913320/9419ce8b-c803-40b7-82bb-9ccd64971676) +![VSCode debugging widget](./img/vscode-debug-widget.png) -![image](https://github.com/mattermost/mattermost-developer-documentation/assets/6913320/f28681c3-c256-41a1-b1f4-835f96628d6a) +![VSCode debugger ready](./img/vscode-debug-ready.png) Your IDE's debugger is now running and ready to pause your plugin's execution at any breakpoints you set in the IDE. diff --git a/docs/develop/integrate/plugins/img/plugin-management.png b/docs/develop/integrate/plugins/img/plugin-management.png new file mode 100644 index 00000000000..3f902fc9498 Binary files /dev/null and b/docs/develop/integrate/plugins/img/plugin-management.png differ diff --git a/docs/develop/integrate/plugins/img/vscode-debug-ready.png b/docs/develop/integrate/plugins/img/vscode-debug-ready.png new file mode 100644 index 00000000000..a4f7f176c4d Binary files /dev/null and b/docs/develop/integrate/plugins/img/vscode-debug-ready.png differ diff --git a/docs/develop/integrate/plugins/img/vscode-debug-widget.png b/docs/develop/integrate/plugins/img/vscode-debug-widget.png new file mode 100644 index 00000000000..8bc3f1e86cd Binary files /dev/null and b/docs/develop/integrate/plugins/img/vscode-debug-widget.png differ diff --git a/docs/develop/integrate/plugins/using-and-managing-plugins.md b/docs/develop/integrate/plugins/using-and-managing-plugins.md index 0f25cea3182..5485c77e4e0 100644 --- a/docs/develop/integrate/plugins/using-and-managing-plugins.md +++ b/docs/develop/integrate/plugins/using-and-managing-plugins.md @@ -66,7 +66,7 @@ In v5.16 and v5.17 the Marketplace only supports the installation of new plugins There are two settings in **System Console > Plugin Management**: -![](https://user-images.githubusercontent.com/915956/66892854-94660d80-efa1-11e9-805c-a85223d43a07.png) +![Plugin Management settings in the System Console](./img/plugin-management.png) - **Enable Marketplace:** Turns the Marketplace user interface on or off for System Admins (end users cannot see the Marketplace). - **Marketplace URL:** The location of the Marketplace server to query for new plugins. Mattermost hosts a Marketplace for the community and this is the default value for this field. You can also set up your own Marketplace server. diff --git a/docs/develop/integrate/webhooks/incoming/img/incoming-webhook-card.png b/docs/develop/integrate/webhooks/incoming/img/incoming-webhook-card.png new file mode 100644 index 00000000000..60b9f5128f3 Binary files /dev/null and b/docs/develop/integrate/webhooks/incoming/img/incoming-webhook-card.png differ diff --git a/docs/develop/integrate/webhooks/incoming/index.md b/docs/develop/integrate/webhooks/incoming/index.md index b3a613e0328..86d995c2ae3 100644 --- a/docs/develop/integrate/webhooks/incoming/index.md +++ b/docs/develop/integrate/webhooks/incoming/index.md @@ -120,7 +120,7 @@ Content-Type: application/json When there is a `props` object with a `card` property attached to the webhook payload, the posted message displays a small info icon next to the timestamp. Clicking this icon expands the right-hand side panel to display the Markdown included in the `card` property: -![Clicking the info icon opens a right-hand side panel to display Markdown of the `card` property](https://user-images.githubusercontent.com/915956/64055959-ec0cfe80-cb44-11e9-8ee3-b64d47c86032.png) +![Clicking the info icon opens a right-hand side panel to display Markdown of the `card` property](./img/incoming-webhook-card.png) ### Slack compatibility diff --git a/docs/site/docusaurus.config.ts b/docs/site/docusaurus.config.ts index 24f77fd56b2..61535cf10e2 100644 --- a/docs/site/docusaurus.config.ts +++ b/docs/site/docusaurus.config.ts @@ -74,19 +74,7 @@ const config: Config = { locales: ['en'], }, - // Google Fonts: Inter (body) + Archivo Black (headings, free Trade Gothic Heavy fallback). - // Replace with Adobe Fonts kit once Trade Gothic Next licensing is confirmed - // — see PLAN.md §12 open items. - stylesheets: [ - { - href: 'https://fonts.googleapis.com/css2?family=Archivo+Black&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap', - type: 'text/css', - }, - ], - headTags: [ - {tagName: 'link', attributes: {rel: 'preconnect', href: 'https://fonts.googleapis.com'}}, - {tagName: 'link', attributes: {rel: 'preconnect', href: 'https://fonts.gstatic.com', crossorigin: 'anonymous'}}, - ], + // Fonts are self-hosted from src/css/fonts (see the README there). // Use the classic preset for the default Documentation instance. // Developers and API are added as separate plugin instances below @@ -104,7 +92,7 @@ const config: Config = { }, blog: false, theme: { - customCss: ['./src/css/tokens.css', './src/css/custom.css'], + customCss: ['./src/css/fonts.css', './src/css/tokens.css', './src/css/custom.css'], }, } satisfies Preset.Options, ], diff --git a/docs/site/package.json b/docs/site/package.json index 662b27bebb5..7d97b797709 100644 --- a/docs/site/package.json +++ b/docs/site/package.json @@ -6,7 +6,7 @@ "docusaurus": "docusaurus", "start": "docusaurus start", "build": "docusaurus build", - "postbuild": "node scripts/duplicate-redirect-stubs.mjs", + "postbuild": "node scripts/duplicate-redirect-stubs.mjs && node scripts/self-host-openapi-tab-icons.mjs", "stage:agents-docs": "node scripts/stage-agents-docs.mjs", "build:sidebars": "node scripts/gen-documentation-sidebar.mjs && node scripts/gen-developer-sidebar.mjs", "build:openapi:spec": "node scripts/build-openapi.mjs", @@ -17,6 +17,8 @@ "build:plugin-manifest-docs": "mkdir -p data && go run -C scripts/gen-plugin-manifest-docs . > data/plugin-manifest-docs.json.tmp && mv data/plugin-manifest-docs.json.tmp data/plugin-manifest-docs.json", "build:plugin-docs": "npm run build:plugin-godocs && npm run build:plugin-jsdocs && npm run build:plugin-manifest-docs", "check:base-url-attrs": "node scripts/check-base-url-attrs.mjs", + "check:egress": "node scripts/check-egress.mjs", + "test:egress": "node --test scripts/check-egress.test.mjs", "prestart": "npm run stage:agents-docs && npm run build:sidebars && ( [ -f openapi/mattermost-openapi-v4.yaml ] || npm run build:openapi:spec ) && npm run build:openapi:docs && npm run build:plugin-docs", "prebuild": "npm run check:base-url-attrs && npm run stage:agents-docs && npm run build:sidebars && npm run build:openapi && npm run build:plugin-docs", "swizzle": "docusaurus swizzle", diff --git a/docs/site/scripts/check-egress.mjs b/docs/site/scripts/check-egress.mjs new file mode 100644 index 00000000000..78c47b389d4 --- /dev/null +++ b/docs/site/scripts/check-egress.mjs @@ -0,0 +1,571 @@ +#!/usr/bin/env node +// Fail the build when HTML/CSS/JS would fetch an off-origin resource. +// Closed allowlist: security-updates feed + docs.mattermost.com meta/canonical. + +import {readdirSync, readFileSync, statSync} from 'node:fs'; +import {dirname, join, relative, resolve} from 'node:path'; +import {fileURLToPath} from 'node:url'; + +const HERE = dirname(fileURLToPath(import.meta.url)); +const DEFAULT_ROOT = resolve(HERE, '..', 'build'); + +export const FEED_URL = + 'https://securityupdates.mattermost.com/security_updates.json'; +export const DOCS_HOST = 'docs.mattermost.com'; +export const EMPTY_BUILD_MESSAGE = + 'docs/site/build is missing or empty; run npm run build first'; + +// Hosted docs keep YouTube/Wistia players; build-offline-bundle.py strips them +// from the airgap tarball. Allowlisted so check-egress matches the public site. +const HOSTED_EMBED_BASES = [ + 'youtube.com', + 'youtu.be', + 'wistia.com', + 'wistia.net', +]; + +const TEXT_EXT = new Set(['.html', '.css', '.js']); +// Attribute-name boundary: \b matches after - and :, so data-src / xlink:href +// must not count as src / href. Require whitespace, quote, or / before the name. +const ATTR = + /(?<=[\s"'\/])(src|href|poster|data|srcset|content)\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/gi; +const CSS_URL = + /(?:@import\s+(?:url\s*\()?['"]?(?:https?:)?\/\/[^'")\s]+)|(?:url\(\s*['"]?(?:https?:)?\/\/[^'")\s]+)/gi; +// Quoted URL, complete template literal, or template with a remote prefix +// before ${ (e.g. fetch(`https://api.example/${path}`)). +const JS_FETCH = + /\b(?:fetch|import)\s*\(\s*(?:['"]((?:https?:)?\/\/[^'"]+)['"]|`((?:https?:)?\/\/(?:(?!\$\{)[^`])+)`|`((?:https?:)?\/\/[^`$]*)\$\{)/g; +const STYLE_BLOCK = /]*>([\s\S]*?)<\/style>/gi; +const SCRIPT_BLOCK = /]*)>([\s\S]*?)<\/script>/gi; + +const LOAD_RELS = new Set([ + 'stylesheet', + 'preload', + 'modulepreload', + 'preconnect', + 'dns-prefetch', + 'prefetch', + 'prerender', + 'icon', + 'apple-touch-icon', + 'mask-icon', + 'manifest', +]); + +const JSON_SCRIPT_TYPES = new Set([ + 'application/json', + 'application/ld+json', +]); + +export function isRemoteUrl(raw) { + const t = String(raw ?? '').trim(); + if (!t) { + return false; + } + if ( + t.startsWith('#') || + t.startsWith('data:') || + t.startsWith('blob:') || + t.startsWith('mailto:') || + t.startsWith('tel:') + ) { + return false; + } + return t.startsWith('https://') || t.startsWith('http://') || t.startsWith('//'); +} + +export function reportUrl(raw) { + const t = String(raw).trim(); + return t.startsWith('//') ? `https:${t}` : t; +} + +function isAllowedFeed(url) { + return reportUrl(url) === FEED_URL; +} + +function isAllowedDocsMeta(url) { + const reported = reportUrl(url); + if (!reported.startsWith('https://')) { + return false; + } + try { + return new URL(reported).hostname === DOCS_HOST; + } catch { + return false; + } +} + +function isHostedEmbedHost(host) { + return HOSTED_EMBED_BASES.some( + (base) => host === base || host.endsWith('.' + base), + ); +} + +function isYoutubeHost(host) { + return host === 'youtube.com' || host.endsWith('.youtube.com') || host === 'youtu.be' || host.endsWith('.youtu.be'); +} + +function isWistiaHost(host) { + return ( + host === 'wistia.com' || + host.endsWith('.wistia.com') || + host === 'wistia.net' || + host.endsWith('.wistia.net') + ); +} + +/** Allow only player tags/paths used by hosted docs embeds — not arbitrary host traffic. */ +export function isAllowedHostedEmbed(url, kind) { + let parsed; + try { + parsed = new URL(reportUrl(url)); + } catch { + return false; + } + const host = parsed.hostname.toLowerCase(); + if (!isHostedEmbedHost(host)) { + return false; + } + const path = parsed.pathname; + + if (kind === 'iframe[src]') { + if (isYoutubeHost(host) && path.startsWith('/embed/')) { + return true; + } + if (isWistiaHost(host) && (path.startsWith('/embed/') || path.startsWith('/medias/'))) { + return true; + } + return false; + } + if (kind === 'script[src]') { + if (!isWistiaHost(host)) { + return false; + } + return ( + path.startsWith('/assets/external/') || + (path.startsWith('/embed/medias/') && path.endsWith('.jsonp')) + ); + } + // Wistia MDX embed also emits for the swatch image. + if (kind === 'img[src]' || kind === 'link[rel=preload]') { + return isWistiaHost(host) && path.startsWith('/embed/medias/'); + } + return false; +} + +function lineAt(text, index) { + return text.slice(0, index).split('\n').length; +} + +function attrValue(match) { + return match[2] ?? match[3] ?? match[4] ?? ''; +} + +function getAttr(tagOpen, name) { + const re = new RegExp( + `(?<=[\\s"'\\/])${name}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s>]+))`, + 'i', + ); + const m = tagOpen.match(re); + return m ? (m[1] ?? m[2] ?? m[3]) : null; +} + +function enclosingTag(html, attrIndex) { + const start = html.lastIndexOf('<', attrIndex); + if (start < 0) { + return null; + } + const gt = html.indexOf('>', attrIndex); + const raw = gt >= 0 ? html.slice(start, gt + 1) : html.slice(start); + const tagMatch = raw.match(/^<\s*([a-zA-Z][\w:-]*)/); + if (!tagMatch) { + return null; + } + return { + tag: tagMatch[1].toLowerCase(), + rel: getAttr(raw, 'rel'), + property: getAttr(raw, 'property'), + name: getAttr(raw, 'name'), + type: getAttr(raw, 'type'), + }; +} + +function srcsetUrls(value) { + return value + .split(',') + .map((part) => part.trim().split(/\s+/)[0]) + .filter(Boolean); +} + +function relKind(relRaw) { + const rels = (relRaw || '').toLowerCase().trim().split(/\s+/).filter(Boolean); + if (rels.includes('canonical')) { + return 'canonical'; + } + if (rels.includes('alternate')) { + return 'skip'; + } + if (rels.includes('shortcut') && rels.includes('icon')) { + return 'link[rel=shortcut icon]'; + } + const hit = rels.find((r) => LOAD_RELS.has(r)); + return hit ? `link[rel=${hit}]` : 'skip'; +} + +function htmlKind(tag, attr, ctx) { + const t = tag; + const a = attr.toLowerCase(); + + if (t === 'a' || t === 'area') { + return 'skip'; + } + if (t === 'script' && a === 'src') { + return 'script[src]'; + } + if (t === 'link' && a === 'href') { + return relKind(ctx.rel); + } + if (t === 'meta' && a === 'content') { + const prop = (ctx.property || '').toLowerCase(); + const name = (ctx.name || '').toLowerCase(); + if (prop.startsWith('og:')) { + return `meta[property=${prop}]`; + } + if (name.startsWith('twitter:')) { + return `meta[name=${name}]`; + } + return 'skip'; + } + if (t === 'img' && (a === 'src' || a === 'srcset')) { + return `img[${a}]`; + } + if (t === 'source' && (a === 'src' || a === 'srcset')) { + return `source[${a}]`; + } + if (t === 'video' && (a === 'src' || a === 'poster')) { + return `video[${a}]`; + } + if (t === 'audio' && a === 'src') { + return 'audio[src]'; + } + if (t === 'track' && a === 'src') { + return 'track[src]'; + } + if (t === 'iframe' && a === 'src') { + return 'iframe[src]'; + } + if (t === 'embed' && a === 'src') { + return 'embed[src]'; + } + if (t === 'object' && a === 'data') { + return 'object[data]'; + } + return 'skip'; +} + +function pushViolation(violations, file, line, kind, found) { + const url = reportUrl(found); + if (isAllowedFeed(url) || isAllowedHostedEmbed(url, kind)) { + return; + } + violations.push({file, line, kind, found: url}); +} + +function considerUrl(violations, file, line, kind, raw) { + if (kind === 'skip' || !isRemoteUrl(raw)) { + return; + } + if (kind === 'canonical' || kind.startsWith('meta[property=og') || kind.startsWith('meta[name=twitter')) { + if (isAllowedDocsMeta(raw)) { + return; + } + const reportedKind = kind === 'canonical' ? 'link[rel=canonical]' : kind; + pushViolation(violations, file, line, reportedKind, raw); + return; + } + pushViolation(violations, file, line, kind, raw); +} + +function scanHtmlAttrs(html, file, violations) { + ATTR.lastIndex = 0; + let match; + while ((match = ATTR.exec(html))) { + const ctx = enclosingTag(html, match.index); + if (!ctx) { + continue; + } + const attr = match[1]; + const kind = htmlKind(ctx.tag, attr, ctx); + const value = attrValue(match); + const line = lineAt(html, match.index); + if (attr.toLowerCase() === 'srcset') { + for (const candidate of srcsetUrls(value)) { + considerUrl(violations, file, line, kind, candidate); + } + } else { + considerUrl(violations, file, line, kind, value); + } + } +} + +function cssKind(matchText) { + return /@import/i.test(matchText) ? 'css @import' : 'css url()'; +} + +function urlFromCssMatch(text) { + const found = text.match(/((?:https?:)?\/\/[^'")\s]+)/); + return found ? found[1] : text; +} + +function scanCssIn(text, file, violations, fullFile, bodyStart) { + CSS_URL.lastIndex = 0; + let match; + while ((match = CSS_URL.exec(text))) { + const raw = urlFromCssMatch(match[0]); + if (!isRemoteUrl(raw)) { + continue; + } + const index = (bodyStart ?? 0) + match.index; + const source = fullFile ?? text; + pushViolation(violations, file, lineAt(source, index), cssKind(match[0]), raw); + } +} + +function scanJs(text, file, violations, fullFile, bodyStart) { + JS_FETCH.lastIndex = 0; + let match; + while ((match = JS_FETCH.exec(text))) { + const raw = match[1] ?? match[2] ?? match[3]; + if (!isRemoteUrl(raw)) { + continue; + } + const index = (bodyStart ?? 0) + match.index; + const source = fullFile ?? text; + const kind = match[0].trimStart().startsWith('import') + ? 'import()' + : 'fetch()'; + considerUrl(violations, file, lineAt(source, index), kind, raw); + } +} + +function isJsonScript(attrText) { + const type = (getAttr(` + + + edit + + +`, + }, + css: {'main.css': '@font-face { src: url(./fonts/inter.woff2); }'}, + js: {'app.js': `fetch("${FEED_URL}");`}, + }); + assert.equal(hits.length, 0); + }); + + it('flags script[src]', () => { + const hits = scanSources({ + html: {'index.html': ''}, + }); + assert.equal(hits.length, 1); + assert.equal(hits[0].kind, 'script[src]'); + assert.equal(hits[0].found, 'https://cdn.example.com/foo.js'); + }); + + it('flags link[rel=preconnect]', () => { + const hits = scanSources({ + html: { + 'index.html': + '', + }, + }); + assert.equal(hits.length, 1); + assert.equal(hits[0].kind, 'link[rel=preconnect]'); + assert.equal(hits[0].found, 'https://fonts.googleapis.com'); + }); + + it('flags link[rel=stylesheet]', () => { + const hits = scanSources({ + html: { + 'index.html': + '', + }, + }); + assert.equal(hits.length, 1); + assert.equal(hits[0].kind, 'link[rel=stylesheet]'); + }); + + it('flags SearchBar preconnect', () => { + const hits = scanSources({ + html: { + 'index.html': + '', + }, + }); + assert.equal(hits.length, 1); + assert.equal(hits[0].kind, 'link[rel=preconnect]'); + assert.equal(hits[0].found, 'https://ABC-dsn.algolia.net'); + }); + + it('flags img[src]', () => { + const hits = scanSources({ + html: {'index.html': ''}, + }); + assert.equal(hits.length, 1); + assert.equal(hits[0].kind, 'img[src]'); + }); + + it('flags only the https srcset candidate', () => { + const hits = scanSources({ + html: { + 'index.html': + '', + }, + }); + assert.equal(hits.length, 1); + assert.equal(hits[0].kind, 'img[srcset]'); + assert.equal(hits[0].found, 'https://cdn.example.com/a.png'); + }); + + it('flags protocol-relative script[src] as https', () => { + const hits = scanSources({ + html: {'index.html': ''}, + }); + assert.equal(hits.length, 1); + assert.equal(hits[0].kind, 'script[src]'); + assert.equal(hits[0].found, 'https://cdn.example.com/x.js'); + }); + + it('flags css @import and url()', () => { + const hits = scanSources({ + html: {'index.html': stubHtml()}, + css: { + 'main.css': + '@import url("https://fonts.googleapis.com/css");\n' + + 'body { background: url("https://fonts.gstatic.com/s/x.woff2"); }', + }, + }); + assert.equal(hits.length, 2); + assert.deepEqual(kinds(hits).sort(), ['css @import', 'css url()']); + assert.ok(found(hits).includes('https://fonts.googleapis.com/css')); + assert.ok(found(hits).includes('https://fonts.gstatic.com/s/x.woff2')); + }); + + it('flags fetch()', () => { + const hits = scanSources({ + html: {'index.html': stubHtml()}, + js: {'app.js': 'fetch("https://evil.example/x");'}, + }); + assert.equal(hits.length, 1); + assert.equal(hits[0].kind, 'fetch()'); + assert.equal(hits[0].found, 'https://evil.example/x'); + }); + + it('flags fetch() with a template literal', () => { + const hits = scanSources({ + html: {'index.html': stubHtml()}, + js: {'app.js': 'fetch(`https://evil.example/template`);'}, + }); + assert.equal(hits.length, 1); + assert.equal(hits[0].kind, 'fetch()'); + assert.equal(hits[0].found, 'https://evil.example/template'); + }); + + it('flags remote prefix before ${', () => { + const hits = scanSources({ + html: {'index.html': stubHtml()}, + js: {'app.js': 'fetch(`https://api.example/${path}`);'}, + }); + assert.equal(hits.length, 1); + assert.equal(hits[0].kind, 'fetch()'); + assert.equal(hits[0].found, 'https://api.example/'); + }); + + it('ignores data-src and xlink:href false positives', () => { + const hits = scanSources({ + html: { + 'index.html': ` + + +`, + }, + }); + assert.equal(hits.length, 0); + }); + + it('still scans inline script body when only data-src is set', () => { + const hits = scanSources({ + html: { + 'index.html': + '', + }, + }); + assert.equal(hits.length, 1); + assert.equal(hits[0].kind, 'fetch()'); + }); + + it('allows the security bulletin URL', () => { + const hits = scanSources({ + html: {'index.html': stubHtml()}, + js: {'app.js': `fetch("${FEED_URL}");`}, + }); + assert.equal(hits.length, 0); + }); + + it('ignores and ', () => { + const hits = scanSources({ + html: { + 'index.html': `forum +github +pricing +map`, + }, + }); + assert.equal(hits.length, 0); + }); + + it('does not parse application/json as JS', () => { + const hits = scanSources({ + html: { + 'index.html': + '', + }, + }); + assert.equal(hits.length, 0); + }); + + it('ignores SVG xmlns', () => { + const hits = scanSources({ + html: { + 'index.html': '', + }, + }); + assert.equal(hits.length, 0); + }); + + it('flags og:image off docs.mattermost.com', () => { + const hits = scanSources({ + html: { + 'index.html': + '', + }, + }); + assert.equal(hits.length, 1); + assert.equal(hits[0].found, 'https://cdn.example.com/share.png'); + }); + + it('throws when no HTML is present', () => { + assert.throws(() => scanSources({css: {'a.css': 'body{}'}}), { + message: EMPTY_BUILD_MESSAGE, + }); + }); + + it('allows YouTube iframes and Wistia scripts/images/preload', () => { + const hits = scanSources({ + html: { + 'index.html': ` + + + +`, + }, + }); + assert.equal(hits.length, 0); + }); + + it('rejects fetch() to an embed host', () => { + const hits = scanSources({ + html: {'index.html': stubHtml()}, + js: {'app.js': 'fetch("https://www.youtube.com/embed/abc");'}, + }); + assert.equal(hits.length, 1); + assert.equal(hits[0].kind, 'fetch()'); + assert.equal(hits[0].found, 'https://www.youtube.com/embed/abc'); + }); + + it('rejects non-player paths on embed hosts', () => { + const hits = scanSources({ + html: { + 'index.html': + '', + }, + }); + assert.equal(hits.length, 1); + assert.equal(hits[0].kind, 'script[src]'); + }); + + it('still flags non-embed remote scripts', () => { + const hits = scanSources({ + html: { + 'index.html': + '', + }, + }); + assert.equal(hits.length, 1); + }); +}); + +describe('isAllowedHostedEmbed', () => { + it('allows player kinds/paths only', () => { + assert.equal( + isAllowedHostedEmbed('https://www.youtube.com/embed/x', 'iframe[src]'), + true, + ); + assert.equal( + isAllowedHostedEmbed('//fast.wistia.com/embed/medias/x', 'iframe[src]'), + true, + ); + assert.equal( + isAllowedHostedEmbed( + 'https://fast.wistia.com/assets/external/E-v1.js', + 'script[src]', + ), + true, + ); + assert.equal( + isAllowedHostedEmbed( + 'https://fast.wistia.com/embed/medias/x/swatch', + 'img[src]', + ), + true, + ); + assert.equal( + isAllowedHostedEmbed( + 'https://fast.wistia.com/embed/medias/x/swatch', + 'link[rel=preload]', + ), + true, + ); + assert.equal( + isAllowedHostedEmbed('https://www.youtube.com/embed/x', 'fetch()'), + false, + ); + assert.equal( + isAllowedHostedEmbed('https://www.youtube.com/watch?v=x', 'iframe[src]'), + false, + ); + assert.equal( + isAllowedHostedEmbed('https://cdn.example.com/x', 'iframe[src]'), + false, + ); + }); +}); + +describe('CLI smoke (temp dir)', () => { + const root = mkdtempSync(join(tmpdir(), 'check-egress-')); + const cleanDir = join(root, 'clean'); + const dirtyDir = join(root, 'dirty'); + const emptyDir = join(root, 'empty'); + + mkdirSync(cleanDir); + mkdirSync(dirtyDir); + mkdirSync(emptyDir); + writeFileSync( + join(cleanDir, 'index.html'), + '', + ); + writeFileSync( + join(dirtyDir, 'index.html'), + '', + ); + + after(() => { + rmSync(root, {recursive: true, force: true}); + }); + + function runCli(dir) { + return spawnSync(process.execPath, [SCRIPT, dir], {encoding: 'utf8'}); + } + + it('scanBuild matches scanSources on a temp tree', () => { + assert.equal(scanBuild(cleanDir).length, 0); + assert.equal(scanBuild(dirtyDir).length, 1); + }); + + it('exits 0 on a clean tree', () => { + const result = runCli(cleanDir); + assert.equal(result.status, 0, result.stderr); + }); + + it('exits 1 when violations exist', () => { + const result = runCli(dirtyDir); + assert.equal(result.status, 1); + assert.match(result.stderr, /script\[src\]/); + }); + + it('exits 1 on an empty tree', () => { + const result = runCli(emptyDir); + assert.equal(result.status, 1); + assert.match(result.stderr, /missing or empty/); + }); + + it('main() returns 1 on violations', () => { + assert.equal(main([dirtyDir]), 1); + }); + + it('main() returns 0 on clean', () => { + assert.equal(main([cleanDir]), 0); + }); +}); diff --git a/docs/site/scripts/self-host-openapi-tab-icons.mjs b/docs/site/scripts/self-host-openapi-tab-icons.mjs new file mode 100644 index 00000000000..22593d05104 --- /dev/null +++ b/docs/site/scripts/self-host-openapi-tab-icons.mjs @@ -0,0 +1,51 @@ +#!/usr/bin/env node +// Rewrite OpenAPI CodeTabs icon url()s from raw.githubusercontent.com +// (devicons/devicon) to static/img/devicons. + +import {existsSync, readdirSync, readFileSync, writeFileSync} from 'node:fs'; +import {dirname, join, resolve} from 'node:path'; +import {fileURLToPath} from 'node:url'; + +const HERE = dirname(fileURLToPath(import.meta.url)); +const SITE = resolve(HERE, '..'); +const BUILD = join(SITE, 'build'); +const ICONS = join(SITE, 'static', 'img', 'devicons'); +const REMOTE = + /url\(\s*['"]?https:\/\/raw\.githubusercontent\.com\/devicons\/devicon\/master\/icons\/[^/]+\/([^'")\s]+)['"]?\s*\)/g; + +const icons = new Set(readdirSync(ICONS).filter((n) => n.endsWith('.svg'))); +const cssDir = join(BUILD, 'assets', 'css'); +if (!existsSync(cssDir)) { + console.error(`[self-host-openapi-tab-icons] ${cssDir} not found; run \`docusaurus build\` first.`); + process.exit(1); +} +let rewritten = 0; +let missing = []; + +for (const name of readdirSync(cssDir)) { + if (!name.endsWith('.css')) { + continue; + } + const file = join(cssDir, name); + const original = readFileSync(file, 'utf8'); + const next = original.replace(REMOTE, (match, basename) => { + if (!icons.has(basename)) { + missing.push(basename); + return match; + } + rewritten++; + return `url(../../img/devicons/${basename})`; + }); + if (next !== original) { + writeFileSync(file, next); + } +} + +if (missing.length > 0) { + console.error( + `[self-host-openapi-tab-icons] missing local icon(s): ${[...new Set(missing)].join(', ')}`, + ); + process.exit(1); +} + +console.log(`[self-host-openapi-tab-icons] rewrote ${rewritten} url() in assets/css`); diff --git a/docs/site/src/components/SecurityUpdates/feed.ts b/docs/site/src/components/SecurityUpdates/feed.ts index 5158d54a383..cdc80e35300 100644 --- a/docs/site/src/components/SecurityUpdates/feed.ts +++ b/docs/site/src/components/SecurityUpdates/feed.ts @@ -146,7 +146,16 @@ export async function fetchSecurityUpdates(): Promise<{ tabs: SecurityUpdateTab[]; lastModified: string | null; }> { - const response = await fetch(FEED_URL, {cache: 'no-store'}); + let response: Response; + try { + response = await fetch(FEED_URL, {cache: 'no-store'}); + } catch { + // Prefer a clear offline/unreachable message over a raw "Failed to fetch". + throw new Error( + `This table is generated from a live feed at ${FEED_URL}, which could not be reached. ` + + 'If you are reading the documentation bundled with a Mattermost release, it requires internet access and is not available offline.', + ); + } if (!response.ok) { throw new Error(`Security updates feed returned ${response.status}.`); } diff --git a/docs/site/src/css/custom.css b/docs/site/src/css/custom.css index a41cb516d33..c33de497f9b 100644 --- a/docs/site/src/css/custom.css +++ b/docs/site/src/css/custom.css @@ -126,10 +126,10 @@ body { -moz-osx-font-smoothing: grayscale; } -/* Headlines target Trade Gothic Next Heavy proportions: tighter set - * than Archivo Black's default. We tune letter-spacing per size and - * apply a mild horizontal squeeze via font-stretch where the platform - * supports it (no-op on Archivo Black, which is fixed-width). +/* Headlines run a tighter set than Archivo Black's default. We tune + * letter-spacing per size and apply a mild horizontal squeeze via + * font-stretch where the platform supports it (no-op on Archivo Black, + * which is fixed-width). * * h1 used to be 900-weight Archivo Black, but that read as too * heavy/shouty for page titles at body-copy reading distance — same diff --git a/docs/site/src/css/fonts.css b/docs/site/src/css/fonts.css new file mode 100644 index 00000000000..8b1443ccef0 --- /dev/null +++ b/docs/site/src/css/fonts.css @@ -0,0 +1,128 @@ +/* Self-hosted fonts from @fontsource; see fonts/README.md. Relative paths + * so webpack prefixes them for the build baseUrl. latin/latin-ext only. */ + +@font-face { + font-family: 'Inter'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url('./fonts/inter-latin-ext-400-normal.woff2') format('woff2'); + unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; +} + +@font-face { + font-family: 'Inter'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url('./fonts/inter-latin-400-normal.woff2') format('woff2'); + unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; +} + +@font-face { + font-family: 'Inter'; + font-style: normal; + font-weight: 500; + font-display: swap; + src: url('./fonts/inter-latin-ext-500-normal.woff2') format('woff2'); + unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; +} + +@font-face { + font-family: 'Inter'; + font-style: normal; + font-weight: 500; + font-display: swap; + src: url('./fonts/inter-latin-500-normal.woff2') format('woff2'); + unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; +} + +@font-face { + font-family: 'Inter'; + font-style: normal; + font-weight: 600; + font-display: swap; + src: url('./fonts/inter-latin-ext-600-normal.woff2') format('woff2'); + unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; +} + +@font-face { + font-family: 'Inter'; + font-style: normal; + font-weight: 600; + font-display: swap; + src: url('./fonts/inter-latin-600-normal.woff2') format('woff2'); + unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; +} + +@font-face { + font-family: 'Inter'; + font-style: normal; + font-weight: 700; + font-display: swap; + src: url('./fonts/inter-latin-ext-700-normal.woff2') format('woff2'); + unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; +} + +@font-face { + font-family: 'Inter'; + font-style: normal; + font-weight: 700; + font-display: swap; + src: url('./fonts/inter-latin-700-normal.woff2') format('woff2'); + unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; +} + +@font-face { + font-family: 'Archivo Black'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url('./fonts/archivo-black-latin-ext-400-normal.woff2') format('woff2'); + unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; +} + +@font-face { + font-family: 'Archivo Black'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url('./fonts/archivo-black-latin-400-normal.woff2') format('woff2'); + unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; +} + +@font-face { + font-family: 'JetBrains Mono'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url('./fonts/jetbrains-mono-latin-ext-400-normal.woff2') format('woff2'); + unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; +} + +@font-face { + font-family: 'JetBrains Mono'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url('./fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2'); + unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; +} + +@font-face { + font-family: 'JetBrains Mono'; + font-style: normal; + font-weight: 600; + font-display: swap; + src: url('./fonts/jetbrains-mono-latin-ext-600-normal.woff2') format('woff2'); + unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; +} + +@font-face { + font-family: 'JetBrains Mono'; + font-style: normal; + font-weight: 600; + font-display: swap; + src: url('./fonts/jetbrains-mono-latin-600-normal.woff2') format('woff2'); + unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; +} diff --git a/docs/site/src/css/fonts/LICENSE-ArchivoBlack.txt b/docs/site/src/css/fonts/LICENSE-ArchivoBlack.txt new file mode 100644 index 00000000000..18a6790c452 --- /dev/null +++ b/docs/site/src/css/fonts/LICENSE-ArchivoBlack.txt @@ -0,0 +1,93 @@ +Copyright 2017 The Archivo Black Project Authors (https://github.com/Omnibus-Type/ArchivoBlack) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/docs/site/src/css/fonts/LICENSE-Inter.txt b/docs/site/src/css/fonts/LICENSE-Inter.txt new file mode 100644 index 00000000000..40589daa9de --- /dev/null +++ b/docs/site/src/css/fonts/LICENSE-Inter.txt @@ -0,0 +1,93 @@ +Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter) Inter-Italic[opsz,wght].ttf: Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/docs/site/src/css/fonts/LICENSE-JetBrainsMono.txt b/docs/site/src/css/fonts/LICENSE-JetBrainsMono.txt new file mode 100644 index 00000000000..8f7ed671137 --- /dev/null +++ b/docs/site/src/css/fonts/LICENSE-JetBrainsMono.txt @@ -0,0 +1,93 @@ +Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono) JetBrainsMono-Italic[wght].ttf: Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/docs/site/src/css/fonts/README.md b/docs/site/src/css/fonts/README.md new file mode 100644 index 00000000000..63d18871ea4 --- /dev/null +++ b/docs/site/src/css/fonts/README.md @@ -0,0 +1,52 @@ +# Self-hosted web fonts + +These replace the Google Fonts stylesheet the site used to load at runtime so +the docs render without a network dependency on fonts.googleapis.com. + +`@font-face` declarations live in `../fonts.css`, which is registered in +`docusaurus.config.ts` under `presets[0][1].theme.customCss`. Paths there are +relative, so webpack emits the files with the right prefix for whatever +`baseUrl` the site is built against — do not move these into `static/`, where +they would need an absolute `/fonts/...` URL and break the `/documentation/` +build. + +## Source + +Extracted from the [Fontsource](https://fontsource.org) npm packages, which +repackage the upstream Google Fonts releases: + +| Family | Package | Version | +| --- | --- | --- | +| Inter | `@fontsource/inter` | 5.3.0 | +| Archivo Black | `@fontsource/archivo-black` | 5.3.0 | +| JetBrains Mono | `@fontsource/jetbrains-mono` | 5.3.0 | + +These are not runtime dependencies — the `.woff2` files were taken from the +published tarballs and committed directly, matching the approach in +`webapp/channels/src/fonts/`. To refresh them, `npm pack` the package at the +new version, copy the files listed below out of `package/files/`, and update the +`unicode-range` values in `../fonts.css` from the matching `package/.css`. + +## What is included + +Only the subsets and weights the site actually uses, which is why this directory +is around 360 KB rather than several megabytes: + +| Family | Weights | Subsets | +| --- | --- | --- | +| Inter | 400, 500, 600, 700 | latin, latin-ext | +| Archivo Black | 400 | latin, latin-ext | +| JetBrains Mono | 400, 600 | latin, latin-ext | + +Weights match what the old Google Fonts request asked for, so rendering is +unchanged. No italic faces are shipped (none were requested before either); +browsers synthesize them. + +Only `.woff2` is included. Every browser the docs support reads it, and the +`.woff` fallback would roughly double the payload for no practical gain. + +## Licensing + +All three families are licensed under the SIL Open Font License 1.1, which +permits redistribution and bundling. The full license text for each is in this +directory as `LICENSE-*.txt`. diff --git a/docs/site/src/css/fonts/archivo-black-latin-400-normal.woff2 b/docs/site/src/css/fonts/archivo-black-latin-400-normal.woff2 new file mode 100644 index 00000000000..a88b0b53529 Binary files /dev/null and b/docs/site/src/css/fonts/archivo-black-latin-400-normal.woff2 differ diff --git a/docs/site/src/css/fonts/archivo-black-latin-ext-400-normal.woff2 b/docs/site/src/css/fonts/archivo-black-latin-ext-400-normal.woff2 new file mode 100644 index 00000000000..85cf1745ce2 Binary files /dev/null and b/docs/site/src/css/fonts/archivo-black-latin-ext-400-normal.woff2 differ diff --git a/docs/site/src/css/fonts/inter-latin-400-normal.woff2 b/docs/site/src/css/fonts/inter-latin-400-normal.woff2 new file mode 100644 index 00000000000..f15b025d666 Binary files /dev/null and b/docs/site/src/css/fonts/inter-latin-400-normal.woff2 differ diff --git a/docs/site/src/css/fonts/inter-latin-500-normal.woff2 b/docs/site/src/css/fonts/inter-latin-500-normal.woff2 new file mode 100644 index 00000000000..54f0a595dd3 Binary files /dev/null and b/docs/site/src/css/fonts/inter-latin-500-normal.woff2 differ diff --git a/docs/site/src/css/fonts/inter-latin-600-normal.woff2 b/docs/site/src/css/fonts/inter-latin-600-normal.woff2 new file mode 100644 index 00000000000..d1897949fda Binary files /dev/null and b/docs/site/src/css/fonts/inter-latin-600-normal.woff2 differ diff --git a/docs/site/src/css/fonts/inter-latin-700-normal.woff2 b/docs/site/src/css/fonts/inter-latin-700-normal.woff2 new file mode 100644 index 00000000000..a68fb101cd9 Binary files /dev/null and b/docs/site/src/css/fonts/inter-latin-700-normal.woff2 differ diff --git a/docs/site/src/css/fonts/inter-latin-ext-400-normal.woff2 b/docs/site/src/css/fonts/inter-latin-ext-400-normal.woff2 new file mode 100644 index 00000000000..5243e4b2b02 Binary files /dev/null and b/docs/site/src/css/fonts/inter-latin-ext-400-normal.woff2 differ diff --git a/docs/site/src/css/fonts/inter-latin-ext-500-normal.woff2 b/docs/site/src/css/fonts/inter-latin-ext-500-normal.woff2 new file mode 100644 index 00000000000..2ab7ebf6372 Binary files /dev/null and b/docs/site/src/css/fonts/inter-latin-ext-500-normal.woff2 differ diff --git a/docs/site/src/css/fonts/inter-latin-ext-600-normal.woff2 b/docs/site/src/css/fonts/inter-latin-ext-600-normal.woff2 new file mode 100644 index 00000000000..bad65d4b7a4 Binary files /dev/null and b/docs/site/src/css/fonts/inter-latin-ext-600-normal.woff2 differ diff --git a/docs/site/src/css/fonts/inter-latin-ext-700-normal.woff2 b/docs/site/src/css/fonts/inter-latin-ext-700-normal.woff2 new file mode 100644 index 00000000000..c9507e3f354 Binary files /dev/null and b/docs/site/src/css/fonts/inter-latin-ext-700-normal.woff2 differ diff --git a/docs/site/src/css/fonts/jetbrains-mono-latin-400-normal.woff2 b/docs/site/src/css/fonts/jetbrains-mono-latin-400-normal.woff2 new file mode 100644 index 00000000000..585887339ef Binary files /dev/null and b/docs/site/src/css/fonts/jetbrains-mono-latin-400-normal.woff2 differ diff --git a/docs/site/src/css/fonts/jetbrains-mono-latin-600-normal.woff2 b/docs/site/src/css/fonts/jetbrains-mono-latin-600-normal.woff2 new file mode 100644 index 00000000000..59c24e7cb8b Binary files /dev/null and b/docs/site/src/css/fonts/jetbrains-mono-latin-600-normal.woff2 differ diff --git a/docs/site/src/css/fonts/jetbrains-mono-latin-ext-400-normal.woff2 b/docs/site/src/css/fonts/jetbrains-mono-latin-ext-400-normal.woff2 new file mode 100644 index 00000000000..9d97c9b7976 Binary files /dev/null and b/docs/site/src/css/fonts/jetbrains-mono-latin-ext-400-normal.woff2 differ diff --git a/docs/site/src/css/fonts/jetbrains-mono-latin-ext-600-normal.woff2 b/docs/site/src/css/fonts/jetbrains-mono-latin-ext-600-normal.woff2 new file mode 100644 index 00000000000..d5a88f9c17e Binary files /dev/null and b/docs/site/src/css/fonts/jetbrains-mono-latin-ext-600-normal.woff2 differ diff --git a/docs/site/src/css/tokens.css b/docs/site/src/css/tokens.css index e1b5fca0514..532be3f7dc6 100644 --- a/docs/site/src/css/tokens.css +++ b/docs/site/src/css/tokens.css @@ -39,13 +39,10 @@ --mm-marigold-700: #B27F00; /* === Typography === - * Trade Gothic Next is licensed via Adobe Fonts and not embedded yet - * (open item — see PLAN.md §12). Until licensing is confirmed, body uses - * Inter and headlines use Archivo Black, which is the closest free match - * for Trade Gothic Heavy's geometric, ultra-bold display feel. */ - --mm-font-sans: "Inter", "Trade Gothic Next", -apple-system, BlinkMacSystemFont, + * Self-hosted from src/css/fonts (see the README there). */ + --mm-font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", system-ui, sans-serif; - --mm-font-heading: "Archivo Black", "Trade Gothic Next Heavy", + --mm-font-heading: "Archivo Black", "Helvetica Neue", "Impact", system-ui, sans-serif; --mm-font-mono: "JetBrains Mono", "SF Mono", "Menlo", "Consolas", "Liberation Mono", monospace; diff --git a/docs/site/static/img/devicons/bash-plain.svg b/docs/site/static/img/devicons/bash-plain.svg new file mode 100644 index 00000000000..8c8f9341cd5 --- /dev/null +++ b/docs/site/static/img/devicons/bash-plain.svg @@ -0,0 +1 @@ + diff --git a/docs/site/static/img/devicons/c-original.svg b/docs/site/static/img/devicons/c-original.svg new file mode 100644 index 00000000000..5197f2a955a --- /dev/null +++ b/docs/site/static/img/devicons/c-original.svg @@ -0,0 +1 @@ + diff --git a/docs/site/static/img/devicons/csharp-original.svg b/docs/site/static/img/devicons/csharp-original.svg new file mode 100644 index 00000000000..acc487eb512 --- /dev/null +++ b/docs/site/static/img/devicons/csharp-original.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/site/static/img/devicons/dart-original.svg b/docs/site/static/img/devicons/dart-original.svg new file mode 100644 index 00000000000..8c78fdb2631 --- /dev/null +++ b/docs/site/static/img/devicons/dart-original.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/site/static/img/devicons/go-original-wordmark.svg b/docs/site/static/img/devicons/go-original-wordmark.svg new file mode 100644 index 00000000000..0fbf6fd1d7c --- /dev/null +++ b/docs/site/static/img/devicons/go-original-wordmark.svg @@ -0,0 +1 @@ + diff --git a/docs/site/static/img/devicons/java-original.svg b/docs/site/static/img/devicons/java-original.svg new file mode 100644 index 00000000000..051bf254ad7 --- /dev/null +++ b/docs/site/static/img/devicons/java-original.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/site/static/img/devicons/javascript-original.svg b/docs/site/static/img/devicons/javascript-original.svg new file mode 100644 index 00000000000..7975261bd47 --- /dev/null +++ b/docs/site/static/img/devicons/javascript-original.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/site/static/img/devicons/kotlin-original.svg b/docs/site/static/img/devicons/kotlin-original.svg new file mode 100644 index 00000000000..1b8d8f46288 --- /dev/null +++ b/docs/site/static/img/devicons/kotlin-original.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/docs/site/static/img/devicons/nodejs-original.svg b/docs/site/static/img/devicons/nodejs-original.svg new file mode 100644 index 00000000000..61738185b91 --- /dev/null +++ b/docs/site/static/img/devicons/nodejs-original.svg @@ -0,0 +1 @@ + diff --git a/docs/site/static/img/devicons/objectivec-plain.svg b/docs/site/static/img/devicons/objectivec-plain.svg new file mode 100644 index 00000000000..7e3ed4f184d --- /dev/null +++ b/docs/site/static/img/devicons/objectivec-plain.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/site/static/img/devicons/ocaml-original.svg b/docs/site/static/img/devicons/ocaml-original.svg new file mode 100644 index 00000000000..7a020aa92ca --- /dev/null +++ b/docs/site/static/img/devicons/ocaml-original.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/site/static/img/devicons/php-original.svg b/docs/site/static/img/devicons/php-original.svg new file mode 100644 index 00000000000..32b7a5b44cf --- /dev/null +++ b/docs/site/static/img/devicons/php-original.svg @@ -0,0 +1,2 @@ + + diff --git a/docs/site/static/img/devicons/python-original.svg b/docs/site/static/img/devicons/python-original.svg new file mode 100644 index 00000000000..e0e096a24e5 --- /dev/null +++ b/docs/site/static/img/devicons/python-original.svg @@ -0,0 +1 @@ + diff --git a/docs/site/static/img/devicons/r-original.svg b/docs/site/static/img/devicons/r-original.svg new file mode 100644 index 00000000000..970da725aa4 --- /dev/null +++ b/docs/site/static/img/devicons/r-original.svg @@ -0,0 +1 @@ + diff --git a/docs/site/static/img/devicons/ruby-plain.svg b/docs/site/static/img/devicons/ruby-plain.svg new file mode 100644 index 00000000000..0511d405b0f --- /dev/null +++ b/docs/site/static/img/devicons/ruby-plain.svg @@ -0,0 +1 @@ + diff --git a/docs/site/static/img/devicons/rust-original.svg b/docs/site/static/img/devicons/rust-original.svg new file mode 100644 index 00000000000..3f2c9b0ac25 --- /dev/null +++ b/docs/site/static/img/devicons/rust-original.svg @@ -0,0 +1 @@ + diff --git a/docs/site/static/img/devicons/swift-original.svg b/docs/site/static/img/devicons/swift-original.svg new file mode 100644 index 00000000000..68630abe025 --- /dev/null +++ b/docs/site/static/img/devicons/swift-original.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/site/static/img/devicons/windows8-original.svg b/docs/site/static/img/devicons/windows8-original.svg new file mode 100644 index 00000000000..787d8e8f526 --- /dev/null +++ b/docs/site/static/img/devicons/windows8-original.svg @@ -0,0 +1 @@ + \ No newline at end of file