Implement ProgCode identity and real shared reading UI kit
Build and deploy / deploy (push) Successful in 2m39s

This commit is contained in:
huncode committed 2026-10-27 15:19:49 +03:00
1 parent 99c848189e
commit 12562baeb5
2040 files changed
+184656 -181

No files matched your search

@@ -0,0 +1,12 @@
import {notFound} from 'next/navigation';
import ArticlePage from '../../fsd/pages/article';
import AboutPage from '../../fsd/pages/about';
import ResourcesPage from '../../fsd/pages/resources';
import CatalogPage from '../../fsd/pages/catalog';
import {getArticles,getArticleBySlug} from '../../fsd/entities/article';
import routes from '../../data/archive-routes.json';
export const dynamicParams=false;
export function generateStaticParams(){return Object.keys(routes).map(path=>({path:path.split('/').filter(Boolean)}));}
async function lookup(params){const {path}=await params;const route=routes['/'+path.map(decodeURIComponent).join('/')];if(!route)notFound();return route;}
export async function generateMetadata({params}){const route=await lookup(params);if(route.type==='article'){const article=getArticleBySlug(route.slug);return {title:article.title+' — ProgCode',description:article.excerpt,alternates:{canonical:'/articles/'+encodeURIComponent(article.slug)+'/'}};}return {title:(route.type==='index'?route.title:route.type==='about'?'О блоге':'Справочники')+' — ProgCode'};}
export default async function LegacyRoute({params}){const route=await lookup(params);if(route.type==='article'){const article=getArticleBySlug(route.slug);const related=getArticles().filter(item=>item.slug!==article.slug&&item.categories.some(category=>article.categories.includes(category))).slice(0,3);return <ArticlePage article={article} related={related}/>;}if(route.type==='about')return <AboutPage/>;if(route.type==='resources')return <ResourcesPage/>;return <CatalogPage title={route.title} articles={getArticles().filter(article=>route.slugs.includes(article.slug))}/>;}