diff --git a/admin/new.docusaurus.io/functionUtils/playgroundUtils.ts b/admin/new.docusaurus.io/functionUtils/playgroundUtils.ts index 5e7d5e804a..3ecb5cd0f2 100644 --- a/admin/new.docusaurus.io/functionUtils/playgroundUtils.ts +++ b/admin/new.docusaurus.io/functionUtils/playgroundUtils.ts @@ -12,13 +12,15 @@ const CookieName = 'DocusaurusPlaygroundName'; const PlaygroundConfigs = { codesandbox: 'https://codesandbox.io/p/sandbox/github/facebook/docusaurus/tree/main/examples/classic?file=%2FREADME.md', + 'codesandbox-ts': + 'https://codesandbox.io/p/sandbox/github/facebook/docusaurus/tree/main/examples/classic-typescript?file=%2FREADME.md', - // Not updated - // stackblitz: 'https://stackblitz.com/fork/docusaurus', // Slow to load // stackblitz: 'https://stackblitz.com/github/facebook/docusaurus/tree/main/examples/classic', // Dedicated branch: faster load stackblitz: 'https://stackblitz.com/github/facebook/docusaurus/tree/starter', + 'stackblitz-ts': + 'https://stackblitz.com/github/facebook/docusaurus/tree/main/examples/classic-typescript', }; const PlaygroundDocumentationUrl = 'https://docusaurus.io/docs/playground'; diff --git a/admin/new.docusaurus.io/functions/codesandbox-ts.ts b/admin/new.docusaurus.io/functions/codesandbox-ts.ts new file mode 100644 index 0000000000..9e7cb8e020 --- /dev/null +++ b/admin/new.docusaurus.io/functions/codesandbox-ts.ts @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import {createPlaygroundResponse} from '../functionUtils/playgroundUtils'; +import type {Handler} from '@netlify/functions'; + +export const handler: Handler = () => + Promise.resolve(createPlaygroundResponse('codesandbox-ts')); diff --git a/admin/new.docusaurus.io/functions/stackblitz-ts.ts b/admin/new.docusaurus.io/functions/stackblitz-ts.ts new file mode 100644 index 0000000000..67e6c4fbda --- /dev/null +++ b/admin/new.docusaurus.io/functions/stackblitz-ts.ts @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import {createPlaygroundResponse} from '../functionUtils/playgroundUtils'; +import type {Handler} from '@netlify/functions'; + +export const handler: Handler = () => + Promise.resolve(createPlaygroundResponse('stackblitz-ts')); diff --git a/website/src/components/Playground/index.tsx b/website/src/components/Playground/index.tsx index fdd720404c..052f51389e 100644 --- a/website/src/components/Playground/index.tsx +++ b/website/src/components/Playground/index.tsx @@ -19,6 +19,7 @@ const Playgrounds = [ name: '📦 CodeSandbox', image: require('@site/static/img/playgrounds/codesandbox.png'), url: 'https://docusaurus.new/codesandbox', + urlTS: 'https://docusaurus.new/codesandbox-ts', description: ( CodeSandbox is an online code editor and development environment that @@ -31,6 +32,7 @@ const Playgrounds = [ name: '⚡ StackBlitz 🆕', image: require('@site/static/img/playgrounds/stackblitz.png'), url: 'https://docusaurus.new/stackblitz', + urlTS: 'https://docusaurus.new/stackblitz-ts', description: (
@@ -70,9 +73,17 @@ function PlaygroundCard({name, image, url, description}: Props) {

{description}

+
+ + Try it now! + +
- Try it now! + JavaScript + + + TypeScript