overflow hidden auto -itendation

This commit is contained in:
2025-09-29 10:34:30 +02:00
parent 2350bd5336
commit ebf6539b1e

View File

@@ -1,14 +1,13 @@
"use client"; "use client";
import { CitationProvider } from "@/components/context-citation";
import { CitationProvider } from '@/components/context-citation'; import { ReferencesContainer } from "@/components/container-references";
import { ReferencesContainer } from '@/components/container-references'; import { CustomMDX } from "@/components/mdx-custom";
import { CustomMDX } from '@/components/mdx-custom';
import { Breadcrumbs } from "./element-breadcrumbs"; import { Breadcrumbs } from "./element-breadcrumbs";
import Link from 'next/link'; import Link from "next/link";
import { Publication } from '@/lib/publications'; import { Publication } from "@/lib/publications";
import { ProjectNavigation } from './project-navigation'; import { ProjectNavigation } from "./project-navigation";
import { Tag } from 'lucide-react'; import { Tag } from "lucide-react";
import Image from 'next/image'; import Image from "next/image";
interface Post { interface Post {
code: string; code: string;
@@ -22,15 +21,23 @@ interface Post {
}; };
} }
interface NavigationLink { slug: string; title: string; } interface NavigationLink {
slug: string;
title: string;
}
interface ArticleProps { interface ArticleProps {
post: Post; post: Post;
publications: Publication[]; publications: Publication[];
navigation?: { prev: NavigationLink | null; next: NavigationLink | null; }; navigation?: { prev: NavigationLink | null; next: NavigationLink | null };
basePath: string; basePath: string;
} }
export function Article({ post, publications, navigation, basePath }: ArticleProps) { export function Article({
post,
publications,
navigation,
basePath,
}: ArticleProps) {
return ( return (
<CitationProvider publications={publications}> <CitationProvider publications={publications}>
<main className="flex flex-col min-h-[100dvh] space-y-10"> <main className="flex flex-col min-h-[100dvh] space-y-10">
@@ -42,7 +49,9 @@ export function Article({ post, publications, navigation, basePath }: ArticlePro
baseLabel={basePath.charAt(0).toUpperCase() + basePath.slice(1)} baseLabel={basePath.charAt(0).toUpperCase() + basePath.slice(1)}
/> />
{post.frontmatter.date && ( {post.frontmatter.date && (
<time className="text-sm text-muted-foreground" dateTime={post.frontmatter.date}> <time
className="text-sm text-muted-foreground"
dateTime={post.frontmatter.date}>
{new Date(post.frontmatter.date).toLocaleDateString("en-US", { {new Date(post.frontmatter.date).toLocaleDateString("en-US", {
year: "numeric", year: "numeric",
month: "long", month: "long",
@@ -61,7 +70,7 @@ export function Article({ post, publications, navigation, basePath }: ArticlePro
</p> </p>
)} )}
</div> </div>
<article className="prose prose-stone dark:prose-invert max-w-none"> <article className="prose prose-stone dark:prose-invert max-w-none overflow-hidden">
{post.frontmatter.icon && ( {post.frontmatter.icon && (
<div className="float-left mr-4 mb-2"> <div className="float-left mr-4 mb-2">
<Image <Image
@@ -81,7 +90,10 @@ export function Article({ post, publications, navigation, basePath }: ArticlePro
<div className="flex flex-wrap items-center gap-x-2 gap-y-1"> <div className="flex flex-wrap items-center gap-x-2 gap-y-1">
<Tag className="size-4 text-muted-foreground" /> <Tag className="size-4 text-muted-foreground" />
{post.frontmatter.tags.map((tag: string) => ( {post.frontmatter.tags.map((tag: string) => (
<Link key={tag} href={`/tags/${tag}`} className="px-3 py-1 text-sm font-medium bg-secondary text-secondary-foreground transition-colors hover:bg-primary hover:text-primary-foreground"> <Link
key={tag}
href={`/tags/${tag}`}
className="px-3 py-1 text-sm font-medium bg-secondary text-secondary-foreground transition-colors hover:bg-primary hover:text-primary-foreground">
{tag} {tag}
</Link> </Link>
))} ))}
@@ -91,11 +103,15 @@ export function Article({ post, publications, navigation, basePath }: ArticlePro
<ReferencesContainer /> <ReferencesContainer />
{navigation && ( {navigation && (
<ProjectNavigation prev={navigation.prev} next={navigation.next} basePath={basePath} /> <ProjectNavigation
prev={navigation.prev}
next={navigation.next}
basePath={basePath}
/>
)} )}
</div> </div>
</section> </section>
</main> </main>
</CitationProvider> </CitationProvider>
); );
} }