Files
Portfolio/src/app/app.routes.ts
Antonio Ledebuhr 86d6dd085d Add the recruiter Pitch route and rebuild Home for direct-customer work.
Pitch takes the verified profile, metrics and public cases off Home so `/` can speak to small companies in plain language. The Systems Map now sits on the services overview, and both locales stay table-driven.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-26 12:52:12 +02:00

71 lines
2.9 KiB
TypeScript

import { type Type } from '@angular/core';
import { type Routes } from '@angular/router';
import { SITE_CONTENT_DATA } from './core/content/site-content';
import { localeResolver } from './core/i18n/locale.resolver';
import { type AppLocale } from './core/i18n/locale';
import { type AppRouteData } from './core/routing/app-route-data';
import { ROUTE_IDS, type RouteId } from './core/routing/route-ids';
import { LOCALE_PREFIX, ROUTE_SEGMENTS } from './core/routing/route-paths';
type LazyPage = () => Promise<Type<unknown>>;
const PAGE_LOADERS: Record<RouteId, LazyPage> = {
home: () => import('./features/home/home').then((module) => module.HomePage),
pitch: () => import('./features/pitch/pitch').then((module) => module.PitchPage),
services: () => import('./features/services/services').then((module) => module.ServicesPage),
servicesSoftware: () =>
import('./features/services/software/software').then((module) => module.ServicesSoftwarePage),
servicesHardwareNetwork: () =>
import('./features/services/hardware-network/hardware-network').then(
(module) => module.ServicesHardwareNetworkPage,
),
servicesClusters: () =>
import('./features/services/clusters/clusters').then((module) => module.ServicesClustersPage),
servicesAi: () =>
import('./features/services/ai-integration/ai-integration').then(
(module) => module.ServicesAiPage,
),
projects: () => import('./features/projects/projects').then((module) => module.ProjectsPage),
stack: () => import('./features/stack/stack').then((module) => module.StackPage),
about: () => import('./features/about/about').then((module) => module.AboutPage),
contact: () => import('./features/contact/contact').then((module) => module.ContactPage),
imprint: () => import('./features/imprint/imprint').then((module) => module.ImprintPage),
privacy: () => import('./features/privacy/privacy').then((module) => module.PrivacyPage),
notFound: () => import('./features/not-found/not-found').then((module) => module.NotFoundPage),
};
function routeData(routeId: RouteId, locale: AppLocale): AppRouteData {
return { routeId, locale };
}
function localeRoutes(locale: AppLocale): Routes {
const segments = ROUTE_SEGMENTS[locale];
const pages = SITE_CONTENT_DATA[locale].pages;
return ROUTE_IDS.filter((routeId) => routeId !== 'notFound')
.map((routeId) => ({
path: segments[routeId],
loadComponent: PAGE_LOADERS[routeId],
data: routeData(routeId, locale),
title: pages[routeId].title,
resolve: { locale: localeResolver },
}))
.concat([
{
path: '**',
loadComponent: PAGE_LOADERS.notFound,
data: routeData('notFound', locale),
title: pages.notFound.title,
resolve: { locale: localeResolver },
},
]);
}
export const routes: Routes = [
{
path: LOCALE_PREFIX.en,
children: localeRoutes('en'),
},
...localeRoutes('de'),
];