feat: блок «Сейчас» + «Заметки редактора» + ArticleMeta
- NowBlock: live indicator (последняя статья / идёт генерация) + bar-чарт за 7 дней - NotesBlock: карточки заметок редактора с pin - /notes: отдельная страница со всеми заметками - ArticleMeta: раскрывающийся блок «Как сделана эта статья» на странице статьи - В шапку добавлена ссылка «Заметки» (desktop и mobile)
This commit is contained in:
+23
-5
@@ -4,21 +4,23 @@ import Footer from '@/components/Footer';
|
||||
import ArticleCard from '@/components/ArticleCard';
|
||||
import HeroImage from '@/components/HeroImage';
|
||||
import Stats from '@/components/Stats';
|
||||
import NowBlock from '@/components/NowBlock';
|
||||
import NotesBlock from '@/components/NotesBlock';
|
||||
import Reveal from '@/components/Reveal';
|
||||
import { listArticles, listTags, getStats } from '@/lib/engine';
|
||||
import { listArticles, listTags, getStats, getLive, listNotes } from '@/lib/engine';
|
||||
import { Sparkles, ArrowRight } from 'lucide-react';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
export default async function HomePage() {
|
||||
let articles = [];
|
||||
let tags = [];
|
||||
let stats = null;
|
||||
let articles = [], tags = [], stats = null, live = null, notes = [];
|
||||
try {
|
||||
[articles, tags, stats] = await Promise.all([
|
||||
[articles, tags, stats, live, notes] = await Promise.all([
|
||||
listArticles({ limit: 13 }),
|
||||
listTags(),
|
||||
getStats(),
|
||||
getLive(),
|
||||
listNotes({ limit: 6 }),
|
||||
]);
|
||||
} catch (err) {
|
||||
console.error('Home load failed:', err.message);
|
||||
@@ -63,6 +65,13 @@ export default async function HomePage() {
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/* Сейчас — live indicator */}
|
||||
<Reveal>
|
||||
<div className="reveal">
|
||||
<NowBlock live={live} />
|
||||
</div>
|
||||
</Reveal>
|
||||
|
||||
{/* Stats */}
|
||||
<Reveal>
|
||||
<div className="reveal">
|
||||
@@ -99,6 +108,15 @@ export default async function HomePage() {
|
||||
</section>
|
||||
)}
|
||||
|
||||
{/* Заметки редактора */}
|
||||
{notes.length > 0 && (
|
||||
<Reveal>
|
||||
<div className="reveal">
|
||||
<NotesBlock notes={notes} compact />
|
||||
</div>
|
||||
</Reveal>
|
||||
)}
|
||||
|
||||
{/* Tags */}
|
||||
{tags.length > 0 && (
|
||||
<Reveal>
|
||||
|
||||
Reference in New Issue
Block a user