diff --git a/docusaurus.config.js b/docusaurus.config.js index 9b7d5f66e..e2c865f1d 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -136,6 +136,20 @@ const config = { // ... other options } ], + [ + "@docusaurus/plugin-content-docs", + { + id: "typescript", + path: "typescript", + routeBasePath: "docs/typescript", + editUrl: (params) => + `${winglangOrgUrl}/wing/tree/main/docs/typescript/${params.docPath}`, + breadcrumbs: true, + includeCurrentVersion: false, + // sidebarPath: require.resolve('./sidebarsCommunity.js'), + // ... other options + } + ], [ "@docusaurus/plugin-content-docs", { diff --git a/redirects.ts b/redirects.ts index c4b75344f..28dca8949 100644 --- a/redirects.ts +++ b/redirects.ts @@ -128,6 +128,10 @@ export default [ to: "/docs/api/analytics", from: ["/docs/analytics"], }, + { + to: "/docs/typescript/intro", + from: ["/docs/typescript"], + }, { to: '/docs/learn', from: ['/docs/category/examples'] }, // Standard Library redirects for docs v2 { to: '/docs/api/category/aws', from: ['/docs/category/aws'] }, diff --git a/scripts/updateDocs.ts b/scripts/updateDocs.ts index c37c7ad4b..b969ed921 100644 --- a/scripts/updateDocs.ts +++ b/scripts/updateDocs.ts @@ -57,6 +57,13 @@ const authorization = `token ${process.env.GITHUB_TOKEN}`; }); await fs.cp("docs/api", "api_versioned_docs/version-latest", { recursive: true }); + console.log("typescript_versioned_docs/version-latest..."); + await fs.rm("typescript_versioned_docs/version-latest", { + force: true, + recursive: true, + }); + await fs.cp("docs/typescript", "typescript_versioned_docs/version-latest", { recursive: true }); + console.log("example_versioned_docs/version-latest..."); await fs.rm("example_versioned_docs/version-latest", { force: true, diff --git a/versioned_docs/version-latest/09-typescript/index.md b/typescript_versioned_docs/version-latest/00-index.md similarity index 98% rename from versioned_docs/version-latest/09-typescript/index.md rename to typescript_versioned_docs/version-latest/00-index.md index d8bcd8411..3f8cb3650 100644 --- a/versioned_docs/version-latest/09-typescript/index.md +++ b/typescript_versioned_docs/version-latest/00-index.md @@ -1,6 +1,6 @@ --- title: TypeScript For Wing -id: typescript +id: 'intro' --- Wing's CLI has experimental support for TypeScript. diff --git a/versioned_docs/version-latest/09-typescript/01-resources.md b/typescript_versioned_docs/version-latest/01-resources.md similarity index 100% rename from versioned_docs/version-latest/09-typescript/01-resources.md rename to typescript_versioned_docs/version-latest/01-resources.md diff --git a/versioned_docs/version-latest/09-typescript/02-inflights.md b/typescript_versioned_docs/version-latest/02-inflights.md similarity index 100% rename from versioned_docs/version-latest/09-typescript/02-inflights.md rename to typescript_versioned_docs/version-latest/02-inflights.md diff --git a/versioned_docs/version-latest/09-typescript/03-ecosystem.md b/typescript_versioned_docs/version-latest/03-ecosystem.md similarity index 100% rename from versioned_docs/version-latest/09-typescript/03-ecosystem.md rename to typescript_versioned_docs/version-latest/03-ecosystem.md diff --git a/typescript_versioned_sidebars/version-latest-sidebars.json b/typescript_versioned_sidebars/version-latest-sidebars.json new file mode 100644 index 000000000..cff0c94e1 --- /dev/null +++ b/typescript_versioned_sidebars/version-latest-sidebars.json @@ -0,0 +1,8 @@ +{ + "defaultSidebar": [ + { + "type": "autogenerated", + "dirName": "." + } + ] +} diff --git a/typescript_versions.json b/typescript_versions.json new file mode 100644 index 000000000..c24f3d37c --- /dev/null +++ b/typescript_versions.json @@ -0,0 +1,3 @@ +[ + "latest" +] diff --git a/versioned_docs/version-latest/09-typescript/_category_.yml b/versioned_docs/version-latest/09-typescript/_category_.yml deleted file mode 100644 index 7e0b183fb..000000000 --- a/versioned_docs/version-latest/09-typescript/_category_.yml +++ /dev/null @@ -1,3 +0,0 @@ -label: TypeScript -collapsible: true -collapsed: true