Trois surfaces partagent désormais le même design system, Tailwind v4
et React 19 — au lieu d'avoir landing en HTML vanilla, app en React, et
blog en Adonis SSR :
* packages/ui — design system partagé (tokens Tailwind v4 + composants
TSX) extrait depuis apps/web : Brand, Gem, Button, Card, Chip, Eyebrow,
EmptyState. apps/web migre 41 imports vers @rubis/ui.
* apps/landing — nouvelle app Astro 6 SSR (rubis.pro), remplace l'ancienne
landing nginx vanilla. Embarque :
- Landing complète portée en sections React (Hero, Stats, Promise,
HowItWorks, Gamification, Legal, Pricing, FAQ, FinalCTA, Footnotes)
- Pages légales (mentions, confidentialité, CGV) via LegalLayout.astro
- Blog SSR (/blog, /blog/:slug) qui consomme /api/v1/posts
- sitemap.xml, blog/rss.xml, robots.txt en endpoints Astro
- SEO complet (canonical, hreflang, OG, Twitter Card, JSON-LD
Article/BreadcrumbList/Blog/SoftwareApplication)
* apps/api — BlogController réduit à 2 endpoints JSON (GET /api/v1/posts
+ GET /api/v1/posts/:slug). Suppression des templates SSR Adonis
(apps/api/app/blog/), de l'alias #blog/*, des deps react-dom et
@types/react-dom. PostTransformer + PostSummaryTransformer ajoutés.
Le service blog_renderer + le seeder + les 3 articles fondateurs
restent intacts (réutilisés par futurs admin + cron IA).
* Infra :
- Dockerfile.landing (multi-stage Node 22 + tini, Astro standalone)
- k3s/app/landing.yml (Deployment + Service rubis-landing:4321 +
ConfigMap avec API_URL=http://rubis-api.rubis.svc.cluster.local:3333)
- .gitea/workflows/deploy.yml mis à jour pour build rubis-landing
- .gitea/workflows/deploy-web.yml + Dockerfile.web : prennent en
compte packages/ui/ comme dépendance
- Suppression du Dockerfile nginx legacy + k3s/{deployment,service}.yml
- Suppression de landing/ (assets favicons migrés vers
apps/landing/public/)
* Docs : architecture.md (vue d'ensemble + §4bis apps/landing complet,
§3 endpoints JSON blog, layout monorepo), CLAUDE.md (stack technique,
documents associés, déploiement).
Note infra : l'ancien Deployment "rubis" (nginx) et son Service ne sont
PAS supprimés par la CI — à nettoyer manuellement après validation que
Traefik a été repointé sur rubis-landing:4321 dans le repo proxmox.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
62 lines
2.1 KiB
TypeScript
62 lines
2.1 KiB
TypeScript
import { Gem, cn } from "@rubis/ui";
|
|
|
|
import type { PostSummary } from "../../lib/api";
|
|
|
|
const DATE_FMT = new Intl.DateTimeFormat("fr-FR", {
|
|
year: "numeric",
|
|
month: "long",
|
|
day: "numeric",
|
|
});
|
|
|
|
export function PostCard({
|
|
post,
|
|
className,
|
|
}: {
|
|
post: PostSummary;
|
|
className?: string;
|
|
}) {
|
|
const dateLabel = post.publishedAt ? DATE_FMT.format(new Date(post.publishedAt)) : null;
|
|
|
|
return (
|
|
<a
|
|
href={`/blog/${post.slug}`}
|
|
className={cn(
|
|
"group flex flex-col bg-white border border-line rounded-card overflow-hidden",
|
|
"transition-all duration-150",
|
|
"hover:no-underline hover:-translate-y-0.5 hover:border-rubis-light hover:shadow-card",
|
|
className,
|
|
)}
|
|
>
|
|
<div className="aspect-[16/9] flex items-center justify-center bg-gradient-to-br from-rubis-glow to-cream-2">
|
|
{post.heroImageUrl ? (
|
|
<img
|
|
src={post.heroImageUrl}
|
|
alt={post.heroImageAlt ?? post.title}
|
|
loading="lazy"
|
|
className="size-full object-cover"
|
|
/>
|
|
) : (
|
|
<Gem size={56} className="opacity-40" />
|
|
)}
|
|
</div>
|
|
<div className="p-6 flex-1 flex flex-col">
|
|
<div className="flex items-center gap-2 text-[11.5px] uppercase tracking-[0.08em] font-semibold text-ink-3 mb-3">
|
|
{dateLabel && (
|
|
<time dateTime={post.publishedAt ?? undefined}>{dateLabel}</time>
|
|
)}
|
|
{dateLabel && <span aria-hidden className="size-[3px] rounded-full bg-ink-3" />}
|
|
<span>{post.readingTimeMinutes} min de lecture</span>
|
|
</div>
|
|
<h2 className="font-display font-bold text-ink text-[20px] tracking-[-0.018em] leading-[1.2]">
|
|
{post.title}
|
|
</h2>
|
|
<p className="mt-3 flex-1 text-[14.5px] leading-relaxed text-ink-2">{post.excerpt}</p>
|
|
<span className="mt-4 inline-flex items-center gap-1.5 font-display font-semibold text-[14px] text-rubis">
|
|
Lire l'article
|
|
<span className="transition-transform group-hover:translate-x-0.5">→</span>
|
|
</span>
|
|
</div>
|
|
</a>
|
|
);
|
|
}
|