Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions docs/src/app/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
import {Routes} from '@angular/router';
import {CanActivateComponentSidenav} from './pages/component-sidenav/component-sidenav-can-load-guard';

function externalRedirect(target: string) {
return () => {
window.location.href = target;
return ''; // unused due to redirect above
};
}

export const MATERIAL_DOCS_ROUTES: Routes = [
{
path: '',
Expand All @@ -25,6 +32,31 @@ export const MATERIAL_DOCS_ROUTES: Routes = [
// Since https://github.com/angular/components/pull/9574, the cdk-table guide became the overview
// document for the cdk table. To avoid any dead / broken links, we redirect to the new location.
{path: 'guide/cdk-table', redirectTo: '/cdk/table/overview'},
// Component harness, drag & drop docs have moved to angular.dev
{
path: 'cdk/testing',
redirectTo: externalRedirect('https://angular.dev/guide/testing/component-harnesses-overview'),
},
{
path: 'cdk/testing/api',
redirectTo: externalRedirect('https://angular.dev/api#angular_cdk_testing'),
},
{
path: 'cdk/testing/:tab',
redirectTo: externalRedirect('https://angular.dev/guide/testing/component-harnesses-overview'),
},
{
path: 'cdk/drag-drop',
redirectTo: externalRedirect('https://angular.dev/guide/drag-drop'),
},
{
path: 'cdk/drag-drop/api',
redirectTo: externalRedirect('https://angular.dev/api#angular_cdk_drag-drop'),
},
{
path: 'cdk/drag-drop/:tab',
redirectTo: externalRedirect('https://angular.dev/guide/drag-drop'),
},
// In v19, the theming system became based on system variables and the mat.theme mixin.
// The following guides were consolidated into the main theming guide, which redirects
// users to v18 docs if they are looking for this content.
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"build-docs-content": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only ./scripts/build-docs-content-main.mts",
"build-and-check-release-output": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only scripts/build-and-check-release-output.mts",
"dev-app": "ibazel run //src/dev-app:devserver",
"docs-app": "ibazel run //docs:serve",
"universal-app": "bazel run //src/universal-app:server",
"test": "node ./scripts/run-component-tests.js",
"test-local": "pnpm -s test --local",
Expand Down
Loading