feat: enhance components with new features and optimizations

- Added support for conditional rendering of the NekoFollower component in AppShell based on ENABLE_NEKO_FOLLOWER.
- Introduced MarkdownImage component in BlogDetailContent for handling images in markdown, supporting both local and external assets.
- Improved BlogToc component to use IntersectionObserver for better performance in tracking active headings.
- Refactored ContentContent to utilize YoutubeLiteEmbed for embedding YouTube videos, simplifying the video rendering logic.
- Created a new YoutubeLiteEmbed component for lazy loading YouTube videos with thumbnail previews.
- Updated site-settings to include ENABLE_NEKO_FOLLOWER constant for feature toggling.
- Enhanced next.config.ts with image optimization settings for better performance.
- Refactored snippets-content to improve code readability and structure.
- Cleaned up home-hero and home-videos-section components for better layout and performance.
This commit is contained in:
Poyraz Avsever
2026-04-15 10:38:28 +03:00
parent 5fc2658460
commit 0609170073
11 changed files with 438 additions and 207 deletions
+10 -29
View File
@@ -1,38 +1,19 @@
import { Card, Typography } from "poyraz-ui/atoms";
import { Card } from "poyraz-ui/atoms";
import { YOUTUBE_VIDEO_LINKS } from "@/data/youtube-videos";
import { getYoutubeEmbedUrl } from "@/lib/youtube";
import { YoutubeLiteEmbed } from "@/components/youtube-lite-embed";
export function HomeVideosSection() {
return (
<section className="space-y-2">
<div className="grid gap-2 md:grid-cols-3">
{YOUTUBE_VIDEO_LINKS.map((link) => {
const embedUrl = getYoutubeEmbedUrl(link);
return (
<Card key={link} className="overflow-hidden rounded-sm border-border p-0">
{embedUrl ? (
<div className="aspect-video w-full">
<iframe
src={embedUrl}
title="YouTube video oynatıcı"
className="h-full w-full"
loading="lazy"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerPolicy="strict-origin-when-cross-origin"
allowFullScreen
/>
</div>
) : (
<div className="p-3">
<Typography variant="small" className="text-muted-foreground">
Geçersiz video bağlantısı.
</Typography>
</div>
)}
</Card>
);
})}
{YOUTUBE_VIDEO_LINKS.map((link) => (
<Card
key={link}
className="overflow-hidden rounded-sm border-border p-0"
>
<YoutubeLiteEmbed link={link} title="YouTube video oynatici" />
</Card>
))}
</div>
</section>
);