Skip to content

Commit 523b563

Browse files
committed
StackMIREA-0014 // Unify track metadata, fix edit/source links and social preview, enable real theme switching, remove client-side deployment fetches, and improve author stats and search UX
1 parent 4bb07e8 commit 523b563

File tree

19 files changed

+325
-318
lines changed

19 files changed

+325
-318
lines changed

app/authors/page.tsx

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { Metadata } from "next";
33
import { GitHubUserBadge } from "@/components/ui/GitHubUserBadge";
44
import { getDevTeamMembers } from "@/lib/authors";
55
import { getAllDocs } from "@/lib/navigation";
6+
import { getTrackTitle } from "@/lib/tracks";
67

78
export const dynamic = "force-static";
89

@@ -19,16 +20,8 @@ interface AuthorWithSummary {
1920
summary: string;
2021
}
2122

22-
const SECTION_TITLES: Record<string, string> = {
23-
ai: "AI",
24-
bigdata: "BigData",
25-
java: "Java",
26-
python: "Python",
27-
algorithms: "Algorithms"
28-
};
29-
3023
function formatSectionName(section: string) {
31-
return SECTION_TITLES[section.toLowerCase()] ?? section;
24+
return getTrackTitle(section.toLowerCase());
3225
}
3326

3427
function buildSummary(sectionStats: Array<{ section: string; count: number }>) {
@@ -51,7 +44,7 @@ function buildSummary(sectionStats: Array<{ section: string; count: number }>) {
5144
}
5245

5346
function getAuthorsWithSummary() {
54-
const docs = getAllDocs();
47+
const docs = getAllDocs().filter((doc) => !doc.isSectionIndex);
5548
const authorsMap = new Map<
5649
string,
5750
{
@@ -122,7 +115,7 @@ export default function AuthorsPage() {
122115
</header>
123116

124117
<section className="mb-10">
125-
<h2 className="mb-4 text-xl font-semibold tracking-tight">Authors</h2>
118+
<h2 className="mb-4 text-xl font-semibold tracking-tight">Авторы публикаций</h2>
126119
<div className="grid gap-4 lg:grid-cols-2">
127120
{authors.map((author) => (
128121
<article key={author.github} className="rounded-xl border border-border/80 bg-card/70 p-4">
@@ -134,7 +127,7 @@ export default function AuthorsPage() {
134127
</section>
135128

136129
<section>
137-
<h2 className="mb-4 text-xl font-semibold tracking-tight">devTeam</h2>
130+
<h2 className="mb-4 text-xl font-semibold tracking-tight">Команда разработки</h2>
138131
<div className="grid gap-3 sm:grid-cols-2 lg:grid-cols-3">
139132
{devTeam.map((member) => (
140133
<GitHubUserBadge key={member.github} person={member} description={member.role} />
@@ -143,7 +136,7 @@ export default function AuthorsPage() {
143136
</section>
144137

145138
<section className="mt-10 rounded-xl border border-border/80 bg-card/70 p-5">
146-
<h2 className="text-xl font-semibold tracking-tight">Контакты devTeam</h2>
139+
<h2 className="text-xl font-semibold tracking-tight">Контакты команды</h2>
147140
<p className="mt-3 text-sm text-muted-foreground">
148141
Для связи с командой разработки:{" "}
149142
<a href="mailto:[email protected]" className="text-primary transition-opacity hover:opacity-80">

app/docs/[...slug]/page.tsx

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Link from "next/link";
33
import { PenSquare } from "lucide-react";
44
import { notFound } from "next/navigation";
55

6+
import { getBuildInfo } from "@/lib/build-info";
67
import { MobileDocsMenu } from "@/components/layout/MobileDocsMenu";
78
import { Sidebar } from "@/components/layout/Sidebar";
89
import { Toc } from "@/components/layout/Toc";
@@ -47,18 +48,19 @@ export default async function DocPage({ params }: DocPageProps) {
4748
notFound();
4849
}
4950

51+
const buildInfo = getBuildInfo();
5052
const sidebarGroups = getSidebarGroups();
5153
const toc = extractTableOfContents(doc.body);
5254
const pagination = getDocPagination(params.slug);
5355
const content = await compileDocMdx(doc.body);
54-
const editUrl = `${GITHUB_EDIT_ROOT}/${doc.sourcePath}`;
56+
const editUrl = doc.editPath ? `${GITHUB_EDIT_ROOT}/${doc.editPath}` : null;
5557

5658
return (
5759
<>
58-
<MobileDocsMenu groups={sidebarGroups} currentPath={doc.href} />
60+
<MobileDocsMenu buildInfo={buildInfo} groups={sidebarGroups} currentPath={doc.href} />
5961

6062
<div className="mx-auto grid w-full max-w-[1440px] gap-8 px-4 py-8 sm:px-6 lg:grid-cols-[260px_minmax(0,1fr)] lg:px-8 xl:grid-cols-[280px_minmax(0,1fr)_220px]">
61-
<Sidebar groups={sidebarGroups} currentPath={doc.href} />
63+
<Sidebar buildInfo={buildInfo} groups={sidebarGroups} currentPath={doc.href} />
6264

6365
<article className="min-w-0 pb-16">
6466
<Breadcrumbs slug={params.slug} currentTitle={doc.title} />
@@ -69,15 +71,21 @@ export default async function DocPage({ params }: DocPageProps) {
6971
<div className="mt-5">
7072
<GitHubUserBadge person={doc.author} description="Автор публикации" />
7173
</div>
72-
<Link
73-
href={editUrl}
74-
target="_blank"
75-
rel="noreferrer"
76-
className="mt-5 inline-flex items-center gap-2 text-sm text-primary transition-opacity hover:opacity-80"
77-
>
78-
<PenSquare className="size-4" />
79-
Edit on GitHub
80-
</Link>
74+
{editUrl ? (
75+
<Link
76+
href={editUrl}
77+
target="_blank"
78+
rel="noreferrer"
79+
className="mt-5 inline-flex items-center gap-2 text-sm text-primary transition-opacity hover:opacity-80"
80+
>
81+
<PenSquare className="size-4" />
82+
Редактировать источник
83+
</Link>
84+
) : (
85+
<p className="mt-5 text-sm text-muted-foreground">
86+
Эта страница собрана автоматически, поэтому редактирование доступно через исходные материалы раздела.
87+
</p>
88+
)}
8189
</header>
8290

8391
<div className="docs-prose">{content}</div>

app/docs/page.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@ import Link from "next/link";
22
import { ArrowRight } from "lucide-react";
33

44
import { MobileDocsMenu } from "@/components/layout/MobileDocsMenu";
5+
import { getBuildInfo } from "@/lib/build-info";
56
import { getSidebarGroups } from "@/lib/navigation";
67

78
export const dynamic = "force-static";
89

910
export default function DocsIndexPage() {
11+
const buildInfo = getBuildInfo();
1012
const groups = getSidebarGroups();
1113

1214
return (
1315
<>
14-
<MobileDocsMenu groups={groups} currentPath="/docs" />
16+
<MobileDocsMenu buildInfo={buildInfo} groups={groups} currentPath="/docs" />
1517

1618
<div className="mx-auto w-full max-w-[1440px] px-4 py-12 sm:px-6 lg:px-8">
1719
<header className="mb-10">
18-
<h1 className="text-balance text-3xl font-semibold tracking-tight sm:text-4xl">StackMIREA Doc - Актуальные треки</h1>
20+
<h1 className="text-balance text-3xl font-semibold tracking-tight sm:text-4xl">StackMIREA Docs - актуальные треки</h1>
1921
<p className="mt-3 max-w-2xl text-base text-muted-foreground">
2022
Структурированные треки по основным ИТ-дисциплинам с масштабируемой архитектурой статической документации.
2123
</p>

app/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { BASE_PATH, SITE_DESCRIPTION, SITE_NAME, SITE_ORIGIN } from "@/lib/utils
88

99
import "./globals.css";
1010

11-
const socialImage = `${SITE_ORIGIN}${BASE_PATH}/social-card.svg`;
11+
const socialImage = `${SITE_ORIGIN}${BASE_PATH}/preview.png`;
1212

1313
export const metadata: Metadata = {
1414
metadataBase: new URL(`${SITE_ORIGIN}${BASE_PATH}/`),
@@ -48,7 +48,7 @@ export default function RootLayout({ children }: { children: ReactNode }) {
4848
return (
4949
<html lang="ru" suppressHydrationWarning>
5050
<body className="site-background font-sans antialiased">
51-
<ThemeProvider attribute="class" forcedTheme="light" disableTransitionOnChange>
51+
<ThemeProvider attribute="class" defaultTheme="system" enableSystem disableTransitionOnChange>
5252
<div className="flex min-h-screen flex-col">
5353
<Header />
5454
<main className="flex-1">{children}</main>

app/page.tsx

Lines changed: 18 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -3,126 +3,25 @@ import { ArrowRight, Bot, Brain, BrainCircuit, Code2, Database, ExternalLink, Gi
33

44
import { buttonVariants } from "@/components/ui/button";
55
import { cn } from "@/lib/utils";
6+
import { getTrackDefinitions, type TrackIconKey } from "@/lib/tracks";
67

78
export const dynamic = "force-static";
89

9-
const tracks = [
10-
// Keep cards in the same order as sidebar section ordering for predictable navigation.
11-
{
12-
title: "Python",
13-
subtitle: "Практики по OOP, тестированию и функциональному стилю",
14-
href: "/docs/python",
15-
icon: Code2
16-
},
17-
{
18-
title: "AI",
19-
subtitle: "Ноутбуки Notebook1..Notebook8 по курсу ИИ",
20-
href: "/docs/ai",
21-
icon: Bot
22-
},
23-
{
24-
title: "BigData",
25-
subtitle: "Практики по анализу данных, классификации и кластеризации",
26-
href: "/docs/bigdata",
27-
icon: Database
28-
},
29-
{
30-
title: "Java",
31-
subtitle: "24 практики по ООП, коллекциям, MVC и паттернам",
32-
href: "/docs/java",
33-
icon: Brain
34-
},
35-
{
36-
title: "Algorithms",
37-
subtitle: "Методические материалы и структурированные разборы",
38-
href: "/docs/algorithms",
39-
icon: Sigma
40-
},
41-
{
42-
title: "Процедурное программирование",
43-
subtitle: "Базовые конструкции, декомпозиция и процедурный стиль",
44-
href: "/docs/procedural-programming",
45-
icon: Code2
46-
},
47-
{
48-
title: "Объектно ориентированное программирование",
49-
subtitle: "Классы, инкапсуляция, наследование и полиморфизм",
50-
href: "/docs/object-oriented-programming",
51-
icon: Brain
52-
},
53-
{
54-
title: "Структуры и алгоритмы обработки данных (часть 1)",
55-
subtitle: "Введение в структуры данных и базовые алгоритмы",
56-
href: "/docs/data-structures-and-algorithms-part-1",
57-
icon: Sigma
58-
},
59-
{
60-
title: "React",
61-
subtitle: "Компонентная разработка и построение интерфейсов",
62-
href: "/docs/react",
63-
icon: Bot
64-
},
65-
{
66-
title: "Структуры и алгоритмы обработки данных (часть 2)",
67-
subtitle: "Продвинутые алгоритмы и анализ производительности",
68-
href: "/docs/data-structures-and-algorithms-part-2",
69-
icon: Sigma
70-
},
71-
{
72-
title: "Конфигурационное управление",
73-
subtitle: "Версионирование, окружения и управление изменениями",
74-
href: "/docs/configuration-management",
75-
icon: GitPullRequest
76-
},
77-
{
78-
title: "Анализ и концептуальное моделирование систем (часть 1)",
79-
subtitle: "Системный анализ, требования и концептуальные модели",
80-
href: "/docs/systems-analysis-and-conceptual-modeling-part-1",
81-
icon: Database
82-
},
83-
{
84-
title: "Технология разработки программных приложений (часть 1)",
85-
subtitle: "Процессы, паттерны и практики разработки приложений",
86-
href: "/docs/software-application-development-part-1",
87-
icon: Code2
88-
},
89-
{
90-
title: "Интернет вещей",
91-
subtitle: "IoT-архитектуры, обмен данными и интеграции устройств",
92-
href: "/docs/internet-of-things",
93-
icon: Bot
94-
},
95-
{
96-
title: "Моделирование бизнес процессов",
97-
subtitle: "Модели процессов, роли, события и оптимизация",
98-
href: "/docs/business-process-modeling",
99-
icon: Database
100-
},
101-
{
102-
title: "Разработка баз данных",
103-
subtitle: "Проектирование схем, SQL и практика работы с БД",
104-
href: "/docs/database-development",
105-
icon: Database
106-
},
107-
{
108-
title: "Тестирование и верификация ПО",
109-
subtitle: "Unit/Integration тестирование и контроль качества",
110-
href: "/docs/software-testing-and-verification",
111-
icon: ListChecks
112-
},
113-
{
114-
title: "Системное администрирование",
115-
subtitle: "Серверы, сервисы, сети и эксплуатация инфраструктуры",
116-
href: "/docs/system-administration",
117-
icon: Brain
118-
},
119-
{
120-
title: "Управление проектами",
121-
subtitle: "Планирование, сроки, риски и командные процессы",
122-
href: "/docs/project-management",
123-
icon: GitPullRequest
124-
}
125-
];
10+
const iconByKey: Record<TrackIconKey, typeof Bot> = {
11+
bot: Bot,
12+
brain: Brain,
13+
code2: Code2,
14+
database: Database,
15+
gitPullRequest: GitPullRequest,
16+
listChecks: ListChecks,
17+
sigma: Sigma
18+
};
19+
20+
const tracks = getTrackDefinitions().map((track) => ({
21+
...track,
22+
href: `/docs/${track.id}`,
23+
icon: iconByKey[track.iconKey]
24+
}));
12625

12726
const publicationRules = [
12827
{
@@ -255,8 +154,8 @@ export default function HomePage() {
255154
<div className="mb-4 inline-flex rounded-lg border border-border/70 bg-background/70 p-2 text-muted-foreground transition-colors group-hover:text-primary">
256155
<Icon className="size-5" />
257156
</div>
258-
<h2 className="text-base font-semibold leading-snug tracking-tight break-words">{track.title}</h2>
259-
<p className="mt-2 break-words text-sm leading-6 text-muted-foreground">{track.subtitle}</p>
157+
<h2 className="break-words text-base font-semibold leading-snug tracking-tight">{track.title}</h2>
158+
<p className="mt-2 break-words text-sm leading-6 text-muted-foreground">{track.homeSubtitle}</p>
260159
<span className="mt-auto pt-5 inline-flex items-center gap-1.5 text-sm text-primary">
261160
Перейти
262161
<ArrowRight className="size-3.5" />

0 commit comments

Comments
 (0)