Implement ProgCode identity and real shared reading UI kit
Build and deploy / deploy (push) Successful in 2m39s
Build and deploy / deploy (push) Successful in 2m39s
This commit is contained in:
1 parent
99c848189e
commit
12562baeb5
2040 files changed
+184656
-181
No files matched your search
@@ -0,0 +1 @@
|
||||
export {default} from '../fsd/widgets/journal-index';
|
||||
@@ -0,0 +1 @@
|
||||
export {Metrika as default} from '../fsd/features/analytics';
|
||||
@@ -0,0 +1 @@
|
||||
export {Shortlinks as default} from '../fsd/features/shortlinks';
|
||||
@@ -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))}/>;}
|
||||
@@ -0,0 +1,2 @@
|
||||
export const metadata={title:'О блоге — ProgCode'};
|
||||
export {default} from '../../fsd/pages/about';
|
||||
@@ -0,0 +1,2 @@
|
||||
export const metadata={title:'Доступность и чтение — ProgCode'};
|
||||
export {default} from '../../fsd/pages/accessibility';
|
||||
@@ -0,0 +1,6 @@
|
||||
import {notFound} from 'next/navigation';
|
||||
import {getArticles,getArticleBySlug} from '../../../fsd/entities/article';
|
||||
import ArticlePage from '../../../fsd/pages/article';
|
||||
export function generateStaticParams(){return getArticles().map(article=>({slug:article.slug}));}
|
||||
export async function generateMetadata({params}){const {slug}=await params;const article=getArticleBySlug(decodeURIComponent(slug));return article?{title:article.title+' — ProgCode',description:article.excerpt,alternates:{canonical:'/articles/'+encodeURIComponent(article.slug)+'/'}}:{title:'Статья не найдена'};}
|
||||
export default async function ArticleRoute({params}){const {slug}=await params;const article=getArticleBySlug(decodeURIComponent(slug));if(!article)notFound();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}/>}
|
||||
@@ -0,0 +1,3 @@
|
||||
@import '../fsd/shared/styles/tokens.css';
|
||||
@import '../fsd/shared/styles/editorial.css';
|
||||
@import '../fsd/shared/styles/components.css';
|
||||
@@ -0,0 +1,6 @@
|
||||
import './globals.css';
|
||||
import {SiteHeader,SiteFooter} from '../fsd/widgets/site-shell';
|
||||
import {ThemeInit} from '../fsd/features/theme-selection';
|
||||
import {Metrika} from '../fsd/features/analytics';
|
||||
export const metadata={metadataBase:new URL('https://progcode.ru'),icons:{icon:[{url:'/brand/favicon.svg',type:'image/svg+xml'},{url:'/brand/favicon.ico',sizes:'16x16 32x32 48x48'},{url:'/brand/favicon-32.png',sizes:'32x32',type:'image/png'}],apple:[{url:'/brand/favicon-180.png',sizes:'180x180'}]},title:'ProgCode — записки о программировании',description:'D, PHP, Bitrix и JavaScript: разборы механизмов, рабочие рецепты и разговоры с разработчиками.'};
|
||||
export default function RootLayout({children}){return <html lang="ru" suppressHydrationWarning><head><ThemeInit/></head><body><Metrika/><a className="skip-link" href="#main">К содержанию</a><SiteHeader/>{children}<SiteFooter/></body></html>}
|
||||
@@ -0,0 +1 @@
|
||||
export {default} from '../fsd/pages/not-found';
|
||||
@@ -0,0 +1 @@
|
||||
export {default} from '../fsd/pages/home';
|
||||
@@ -0,0 +1,2 @@
|
||||
export const metadata={title:'Приватность и аналитика — ProgCode'};
|
||||
export {default} from '../../fsd/pages/privacy';
|
||||
@@ -0,0 +1,2 @@
|
||||
export const metadata={title:'Справочники разработчика — ProgCode'};
|
||||
export {default} from '../../fsd/pages/resources';
|
||||
@@ -0,0 +1,2 @@
|
||||
export const metadata={title:'Источники и редактура — ProgCode'};
|
||||
export {default} from '../../fsd/pages/sources';
|
||||
@@ -0,0 +1,2 @@
|
||||
export const metadata={title:'JSON-инструмент — ProgCode'};
|
||||
export {default} from '../../fsd/pages/json-tool';
|
||||
@@ -0,0 +1,2 @@
|
||||
export const metadata={title:'Компоненты ProgCode — UI kit'};
|
||||
export {default} from '../../fsd/pages/ui-kit';
|
||||
Reference in new issue
Block a user