feat: блок «Сейчас» + «Заметки редактора» + ArticleMeta
- NowBlock: live indicator (последняя статья / идёт генерация) + bar-чарт за 7 дней - NotesBlock: карточки заметок редактора с pin - /notes: отдельная страница со всеми заметками - ArticleMeta: раскрывающийся блок «Как сделана эта статья» на странице статьи - В шапку добавлена ссылка «Заметки» (desktop и mobile)
This commit is contained in:
@@ -5,6 +5,7 @@ import Footer from '@/components/Footer';
|
||||
import ReadingProgress from '@/components/ReadingProgress';
|
||||
import ScrollToTop from '@/components/ScrollToTop';
|
||||
import ShareButton from '@/components/ShareButton';
|
||||
import ArticleMeta from '@/components/ArticleMeta';
|
||||
import ArticleCard from '@/components/ArticleCard';
|
||||
import { getArticle, listArticles } from '@/lib/engine';
|
||||
import { renderMarkdown, formatDate } from '@/lib/markdown';
|
||||
@@ -108,9 +109,7 @@ export default async function ArticlePage({ params }) {
|
||||
dangerouslySetInnerHTML={{ __html: html }}
|
||||
/>
|
||||
|
||||
<div className="mt-12 pt-6 border-t-soft text-center">
|
||||
<p className="mute text-sm">Статья сгенерирована ИИ под редакторским присмотром.</p>
|
||||
</div>
|
||||
<ArticleMeta article={article} />
|
||||
</article>
|
||||
|
||||
{related.length > 0 && (
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
import Header from '@/components/Header';
|
||||
import Footer from '@/components/Footer';
|
||||
import NotesBlock from '@/components/NotesBlock';
|
||||
import { listNotes } from '@/lib/engine';
|
||||
import { MessageCircle } from 'lucide-react';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
export const metadata = { title: 'Заметки редактора' };
|
||||
|
||||
export default async function NotesPage() {
|
||||
const notes = await listNotes({ limit: 100 });
|
||||
return (
|
||||
<>
|
||||
<Header />
|
||||
<main className="pt-10 pb-16">
|
||||
<div className="container-wide mb-8">
|
||||
<div
|
||||
className="inline-flex items-center gap-2 text-xs accent px-3 py-1.5 rounded-full mb-4"
|
||||
style={{ background: 'rgb(var(--accent) / 0.1)', border: '1px solid rgb(var(--accent) / 0.2)' }}
|
||||
>
|
||||
<MessageCircle className="w-3.5 h-3.5" /> За кулисами
|
||||
</div>
|
||||
<h1 className="text-3xl sm:text-5xl font-bold ink mb-3 leading-tight">
|
||||
Заметки редактора
|
||||
</h1>
|
||||
<p className="mute text-base sm:text-lg max-w-2xl">
|
||||
Короткие мысли, наблюдения, технические заметки и комментарии человека, который следит за блогом. Не статьи — просто записи на полях.
|
||||
</p>
|
||||
</div>
|
||||
<NotesBlock notes={notes} />
|
||||
</main>
|
||||
<Footer />
|
||||
</>
|
||||
);
|
||||
}
|
||||
+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