feat: zeropost-web — публичный AI-блог на zeropost.ru

- Next.js 16, Tailwind с @tailwindcss/typography
- Главная: hero, featured-статья, сетка карточек, облако тегов
- /blog/[slug]: статья со SSG + revalidate 60s, prose typography
- /tag/[name]: фильтр по тегам
- /about: про проект
- /api/cron/generate: endpoint для авто-генерации (защищён x-cron-token)
- SEO: dynamic metadata, OG, sitemap-ready
- Лента грузится с zeropost-engine /api/articles
This commit is contained in:
Alexey Pavlov
2026-05-31 08:50:35 +03:00
parent adea4b80de
commit 6dfe8b8afa
20 changed files with 2913 additions and 0 deletions
+60
View File
@@ -0,0 +1,60 @@
import Link from 'next/link';
import { formatDate } from '@/lib/markdown';
import { Clock } from 'lucide-react';
export default function ArticleCard({ article, featured = false }) {
if (featured) {
return (
<Link
href={`/blog/${article.slug}`}
className="article-card block group p-8 sm:p-10 border-accent/30 hover:border-accent"
>
<div className="flex flex-wrap items-center gap-2 mb-4">
{(article.tags || []).slice(0, 3).map(t => (
<span key={t} className="tag">#{t}</span>
))}
</div>
<h2 className="text-2xl sm:text-3xl font-bold mb-3 group-hover:text-accent2 transition-colors leading-tight">
{article.title}
</h2>
{article.excerpt && (
<p className="text-mute text-base sm:text-lg leading-relaxed line-clamp-3 mb-4">
{article.excerpt}
</p>
)}
<div className="flex items-center gap-4 text-xs text-mute">
<span>{formatDate(article.published_at)}</span>
{article.reading_time && (
<span className="inline-flex items-center gap-1">
<Clock className="w-3 h-3" /> {article.reading_time} мин
</span>
)}
</div>
</Link>
);
}
return (
<Link href={`/blog/${article.slug}`} className="article-card block group">
<div className="flex flex-wrap items-center gap-2 mb-3">
{(article.tags || []).slice(0, 2).map(t => (
<span key={t} className="tag">#{t}</span>
))}
</div>
<h3 className="text-lg font-semibold mb-2 group-hover:text-accent2 transition-colors leading-snug">
{article.title}
</h3>
{article.excerpt && (
<p className="text-mute text-sm line-clamp-3 mb-4">{article.excerpt}</p>
)}
<div className="flex items-center gap-3 text-xs text-mute">
<span>{formatDate(article.published_at)}</span>
{article.reading_time && (
<span className="inline-flex items-center gap-1">
<Clock className="w-3 h-3" /> {article.reading_time} мин
</span>
)}
</div>
</Link>
);
}
+17
View File
@@ -0,0 +1,17 @@
import Link from 'next/link';
export default function Footer() {
return (
<footer className="border-t border-border/60 mt-20">
<div className="container-wide py-10 flex flex-col sm:flex-row items-center justify-between gap-4 text-sm text-mute">
<div>
© {new Date().getFullYear()} ZeroPost генерируется ИИ, читается людьми
</div>
<div className="flex items-center gap-4">
<Link href="/about" className="hover:text-white transition-colors">О проекте</Link>
<a href="https://app.zeropost.ru" className="hover:text-white transition-colors">Сервис</a>
</div>
</div>
</footer>
);
}
+24
View File
@@ -0,0 +1,24 @@
import Link from 'next/link';
import { Sparkles, Github } from 'lucide-react';
export default function Header() {
return (
<header className="border-b border-border/60 sticky top-0 z-20 bg-bg/85 backdrop-blur-md">
<div className="container-wide flex items-center justify-between py-4">
<Link href="/" className="flex items-center gap-2 group">
<div className="w-8 h-8 rounded-lg bg-accent/15 flex items-center justify-center group-hover:bg-accent/25 transition-colors">
<Sparkles className="w-4 h-4 text-accent" />
</div>
<span className="font-bold text-lg tracking-tight">ZeroPost</span>
</Link>
<nav className="flex items-center gap-1 sm:gap-4 text-sm">
<Link href="/" className="btn-ghost text-sm py-1.5">Статьи</Link>
<Link href="/about" className="btn-ghost text-sm py-1.5">О проекте</Link>
<a href="https://app.zeropost.ru" className="btn-primary text-sm py-1.5">
Открыть кабинет
</a>
</nav>
</div>
</header>
);
}