commit 89e98efb7d93a8ba4016aacf5e68e196aa45637b Author: Jens Bech-Sørensen Date: Tue May 6 23:09:47 2025 +0200 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f650315 --- /dev/null +++ b/.gitignore @@ -0,0 +1,27 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules + +# next.js +/.next/ +/out/ + +# production +/build + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# env files +.env* + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts \ No newline at end of file diff --git a/app/globals.css b/app/globals.css new file mode 100644 index 0000000..2d70e5a --- /dev/null +++ b/app/globals.css @@ -0,0 +1,205 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +@layer base { + :root { + --background: 222 30% 7%; /* Darkened background */ + --foreground: 210 20% 98%; + --card: 222 47% 9%; /* Darkened card */ + --card-foreground: 210 20% 98%; + --popover: 222 47% 9%; + --popover-foreground: 210 20% 98%; + --primary: 263.4 70% 50.4%; + --primary-foreground: 210 20% 98%; + --secondary: 222 30% 12%; /* Darkened secondary */ + --secondary-foreground: 210 20% 98%; + --muted: 222 30% 12%; + --muted-foreground: 217.9 10.6% 64.9%; + --accent: 222 30% 12%; + --accent-foreground: 210 20% 98%; + --destructive: 0 62.8% 30.6%; + --destructive-foreground: 210 20% 98%; + --border: 222 30% 12%; + --input: 222 30% 12%; + --ring: 263.4 70% 50.4%; + } +} + +@layer base { + body { + @apply bg-background text-foreground; + } +} + +@keyframes gradient { + 0% { + background-position: 0% 50%; + } + 50% { + background-position: 100% 50%; + } + 100% { + background-position: 0% 50%; + } +} + +.animate-gradient { + background-size: 200% 200%; + animation: gradient 8s ease infinite; +} + +/* Animated background gradients */ +.animated-bg { + position: relative; + overflow: hidden; +} + +.animated-bg::before { + content: ""; + position: absolute; + top: -50%; + left: -50%; + width: 200%; + height: 200%; + background: radial-gradient( + circle at center, + rgba(124, 58, 237, 0.03) 0%, + rgba(124, 58, 237, 0.01) 20%, + rgba(236, 72, 153, 0.01) 40%, + rgba(236, 72, 153, 0) 60%, + transparent 100% + ); + animation: rotate 60s linear infinite; + z-index: -1; +} + +.animated-bg::after { + content: ""; + position: absolute; + top: -50%; + left: -50%; + width: 200%; + height: 200%; + background: radial-gradient( + circle at center, + rgba(236, 72, 153, 0.03) 0%, + rgba(236, 72, 153, 0.01) 20%, + rgba(124, 58, 237, 0.01) 40%, + rgba(124, 58, 237, 0) 60%, + transparent 100% + ); + animation: rotate 40s linear infinite reverse; + z-index: -1; +} + +@keyframes rotate { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +} + +/* Modified post-link to always show the gradient line on hover */ +.post-link { + position: relative; + display: inline-block; + transition: all 0.3s ease; +} + +.post-link::after { + content: ""; + position: absolute; + width: 0; + height: 2px; + bottom: -2px; + left: 0; + background: linear-gradient(90deg, #7c3aed, #ec4899); + transition: width 0.3s ease; +} + +.post-card:hover .post-link::after { + width: 100%; +} + +.post-card { + position: relative; + transition: transform 0.3s ease; +} + +.post-card::before { + content: ""; + position: absolute; + inset: 0; + border-radius: 0.5rem; + padding: 1px; + background: linear-gradient(90deg, rgba(124, 58, 237, 0.2), rgba(236, 72, 153, 0.2)); + -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); + -webkit-mask-composite: xor; + mask-composite: exclude; + opacity: 0; + transition: opacity 0.3s ease; +} + +.post-card:hover { + transform: translateY(-2px); +} + +.post-card:hover::before { + opacity: 1; +} + +.prose { + @apply max-w-none; +} + +.prose a { + @apply text-purple-400 hover:text-pink-400 transition-colors duration-200; +} + +.prose h1, +.prose h2, +.prose h3, +.prose h4 { + @apply text-foreground; +} + +.prose code { + @apply bg-secondary text-foreground px-1 py-0.5 rounded; +} + +.prose pre { + @apply bg-card border border-border/40 rounded-md; +} + +.prose blockquote { + @apply border-l-4 border-purple-400 bg-secondary/50 pl-4 py-1 italic; +} + +.prose img { + @apply rounded-md; +} + +/* Ensure proper scrolling */ +html, +body { + height: 100%; + overflow-x: hidden; + overflow-y: auto; + scroll-behavior: smooth; +} + +/* Ensure content can extend beyond viewport */ +#__next, +main { + min-height: 100%; + display: flex; + flex-direction: column; +} + +/* Reduce spacing between posts for more compact layout */ +.space-y-6 > * + * { + margin-top: 1.25rem; +} diff --git a/app/layout.tsx b/app/layout.tsx new file mode 100644 index 0000000..d6925ea --- /dev/null +++ b/app/layout.tsx @@ -0,0 +1,62 @@ +import type React from "react" +import type { Metadata } from "next" +import { Inter } from "next/font/google" +import "./globals.css" +import { ThemeProvider } from "@/components/theme-provider" +import { Code, ExternalLink, Linkedin } from "lucide-react" + +const inter = Inter({ subsets: ["latin"] }) + +export const metadata: Metadata = { + title: "Minimalist Blog", + description: "A minimalist blog built with Next.js and Markdown", + generator: 'v0.dev' +} + +export default function RootLayout({ + children, +}: { + children: React.ReactNode +}) { + return ( + + + +
+
+

+ Minimalist Blog +

+
+ + + public code + + + + + linkedin + + +
+
+
{children}
+
+

© {new Date().getFullYear()} Minimalist Blog. All rights reserved.

+
+
+
+ + + ) +} diff --git a/app/page.tsx b/app/page.tsx new file mode 100644 index 0000000..a5f71ef --- /dev/null +++ b/app/page.tsx @@ -0,0 +1,26 @@ +import { getAllPosts } from "@/lib/api" +import { PostPreview } from "@/components/post-preview" + +// Make sure this is a Server Component (default in App Router) +export default function Home() { + // Use synchronous data fetching to avoid suspense issues + const posts = getAllPosts() + + // Sort posts by date (newest first) + const sortedPosts = posts.sort((a, b) => new Date(b.metadata.date).getTime() - new Date(a.metadata.date).getTime()) + + return ( +
+
+

Blog posts

+
    + {sortedPosts.map((post) => ( +
  • + +
  • + ))} +
+
+
+ ) +} diff --git a/app/posts/[slug]/page.tsx b/app/posts/[slug]/page.tsx new file mode 100644 index 0000000..926efea --- /dev/null +++ b/app/posts/[slug]/page.tsx @@ -0,0 +1,68 @@ +import { getPostBySlug, getAllPosts } from "@/lib/api" +import { notFound } from "next/navigation" +import type { Metadata } from "next" +import Link from "next/link" +import { ArrowLeft } from "lucide-react" +import { Suspense } from "react" +import { MDXContent } from "@/components/mdx-content" + +export function generateStaticParams() { + const posts = getAllPosts() + return posts.map((post) => ({ + slug: post.slug, + })) +} + +export function generateMetadata({ params }: { params: { slug: string } }): Metadata { + const post = getPostBySlug(params.slug) + + if (!post) { + return { + title: "Post Not Found", + } + } + + return { + title: post.metadata.title, + description: post.metadata.excerpt, + } +} + +export default function Post({ params }: { params: { slug: string } }) { + const post = getPostBySlug(params.slug) + + if (!post) { + notFound() + } + + return ( +
+ + + Back to all posts + + +
+

+ {post.metadata.title} +

+ +
+ +
+ Loading content...
}> + + + +
+ ) +} diff --git a/components.json b/components.json new file mode 100644 index 0000000..d9ef0ae --- /dev/null +++ b/components.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://ui.shadcn.com/schema.json", + "style": "default", + "rsc": true, + "tsx": true, + "tailwind": { + "config": "tailwind.config.ts", + "css": "app/globals.css", + "baseColor": "neutral", + "cssVariables": true, + "prefix": "" + }, + "aliases": { + "components": "@/components", + "utils": "@/lib/utils", + "ui": "@/components/ui", + "lib": "@/lib", + "hooks": "@/hooks" + }, + "iconLibrary": "lucide" +} \ No newline at end of file diff --git a/components/mdx-content.tsx b/components/mdx-content.tsx new file mode 100644 index 0000000..0018931 --- /dev/null +++ b/components/mdx-content.tsx @@ -0,0 +1,9 @@ +import { MDXRemote } from "next-mdx-remote/rsc" + +interface MDXContentProps { + content: string +} + +export function MDXContent({ content }: MDXContentProps) { + return +} diff --git a/components/post-preview.tsx b/components/post-preview.tsx new file mode 100644 index 0000000..6497b3f --- /dev/null +++ b/components/post-preview.tsx @@ -0,0 +1,26 @@ +import Link from "next/link" +import type { Post } from "@/lib/api" + +interface PostPreviewProps { + post: Post +} + +export function PostPreview({ post }: PostPreviewProps) { + return ( +
+ +

+ {post.metadata.title} +

+ +

{post.metadata.excerpt}

+ +
+ ) +} diff --git a/components/theme-provider.tsx b/components/theme-provider.tsx new file mode 100644 index 0000000..55c2f6e --- /dev/null +++ b/components/theme-provider.tsx @@ -0,0 +1,11 @@ +'use client' + +import * as React from 'react' +import { + ThemeProvider as NextThemesProvider, + type ThemeProviderProps, +} from 'next-themes' + +export function ThemeProvider({ children, ...props }: ThemeProviderProps) { + return {children} +} diff --git a/components/ui/accordion.tsx b/components/ui/accordion.tsx new file mode 100644 index 0000000..24c788c --- /dev/null +++ b/components/ui/accordion.tsx @@ -0,0 +1,58 @@ +"use client" + +import * as React from "react" +import * as AccordionPrimitive from "@radix-ui/react-accordion" +import { ChevronDown } from "lucide-react" + +import { cn } from "@/lib/utils" + +const Accordion = AccordionPrimitive.Root + +const AccordionItem = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AccordionItem.displayName = "AccordionItem" + +const AccordionTrigger = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + + svg]:rotate-180", + className + )} + {...props} + > + {children} + + + +)) +AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName + +const AccordionContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + +
{children}
+
+)) + +AccordionContent.displayName = AccordionPrimitive.Content.displayName + +export { Accordion, AccordionItem, AccordionTrigger, AccordionContent } diff --git a/components/ui/alert-dialog.tsx b/components/ui/alert-dialog.tsx new file mode 100644 index 0000000..25e7b47 --- /dev/null +++ b/components/ui/alert-dialog.tsx @@ -0,0 +1,141 @@ +"use client" + +import * as React from "react" +import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog" + +import { cn } from "@/lib/utils" +import { buttonVariants } from "@/components/ui/button" + +const AlertDialog = AlertDialogPrimitive.Root + +const AlertDialogTrigger = AlertDialogPrimitive.Trigger + +const AlertDialogPortal = AlertDialogPrimitive.Portal + +const AlertDialogOverlay = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName + +const AlertDialogContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + + + + +)) +AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName + +const AlertDialogHeader = ({ + className, + ...props +}: React.HTMLAttributes) => ( +
+) +AlertDialogHeader.displayName = "AlertDialogHeader" + +const AlertDialogFooter = ({ + className, + ...props +}: React.HTMLAttributes) => ( +
+) +AlertDialogFooter.displayName = "AlertDialogFooter" + +const AlertDialogTitle = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName + +const AlertDialogDescription = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AlertDialogDescription.displayName = + AlertDialogPrimitive.Description.displayName + +const AlertDialogAction = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName + +const AlertDialogCancel = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName + +export { + AlertDialog, + AlertDialogPortal, + AlertDialogOverlay, + AlertDialogTrigger, + AlertDialogContent, + AlertDialogHeader, + AlertDialogFooter, + AlertDialogTitle, + AlertDialogDescription, + AlertDialogAction, + AlertDialogCancel, +} diff --git a/components/ui/alert.tsx b/components/ui/alert.tsx new file mode 100644 index 0000000..41fa7e0 --- /dev/null +++ b/components/ui/alert.tsx @@ -0,0 +1,59 @@ +import * as React from "react" +import { cva, type VariantProps } from "class-variance-authority" + +import { cn } from "@/lib/utils" + +const alertVariants = cva( + "relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground", + { + variants: { + variant: { + default: "bg-background text-foreground", + destructive: + "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive", + }, + }, + defaultVariants: { + variant: "default", + }, + } +) + +const Alert = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes & VariantProps +>(({ className, variant, ...props }, ref) => ( +
+)) +Alert.displayName = "Alert" + +const AlertTitle = React.forwardRef< + HTMLParagraphElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)) +AlertTitle.displayName = "AlertTitle" + +const AlertDescription = React.forwardRef< + HTMLParagraphElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)) +AlertDescription.displayName = "AlertDescription" + +export { Alert, AlertTitle, AlertDescription } diff --git a/components/ui/aspect-ratio.tsx b/components/ui/aspect-ratio.tsx new file mode 100644 index 0000000..d6a5226 --- /dev/null +++ b/components/ui/aspect-ratio.tsx @@ -0,0 +1,7 @@ +"use client" + +import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio" + +const AspectRatio = AspectRatioPrimitive.Root + +export { AspectRatio } diff --git a/components/ui/avatar.tsx b/components/ui/avatar.tsx new file mode 100644 index 0000000..51e507b --- /dev/null +++ b/components/ui/avatar.tsx @@ -0,0 +1,50 @@ +"use client" + +import * as React from "react" +import * as AvatarPrimitive from "@radix-ui/react-avatar" + +import { cn } from "@/lib/utils" + +const Avatar = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +Avatar.displayName = AvatarPrimitive.Root.displayName + +const AvatarImage = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AvatarImage.displayName = AvatarPrimitive.Image.displayName + +const AvatarFallback = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName + +export { Avatar, AvatarImage, AvatarFallback } diff --git a/components/ui/badge.tsx b/components/ui/badge.tsx new file mode 100644 index 0000000..f000e3e --- /dev/null +++ b/components/ui/badge.tsx @@ -0,0 +1,36 @@ +import * as React from "react" +import { cva, type VariantProps } from "class-variance-authority" + +import { cn } from "@/lib/utils" + +const badgeVariants = cva( + "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", + { + variants: { + variant: { + default: + "border-transparent bg-primary text-primary-foreground hover:bg-primary/80", + secondary: + "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80", + destructive: + "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80", + outline: "text-foreground", + }, + }, + defaultVariants: { + variant: "default", + }, + } +) + +export interface BadgeProps + extends React.HTMLAttributes, + VariantProps {} + +function Badge({ className, variant, ...props }: BadgeProps) { + return ( +
+ ) +} + +export { Badge, badgeVariants } diff --git a/components/ui/breadcrumb.tsx b/components/ui/breadcrumb.tsx new file mode 100644 index 0000000..60e6c96 --- /dev/null +++ b/components/ui/breadcrumb.tsx @@ -0,0 +1,115 @@ +import * as React from "react" +import { Slot } from "@radix-ui/react-slot" +import { ChevronRight, MoreHorizontal } from "lucide-react" + +import { cn } from "@/lib/utils" + +const Breadcrumb = React.forwardRef< + HTMLElement, + React.ComponentPropsWithoutRef<"nav"> & { + separator?: React.ReactNode + } +>(({ ...props }, ref) =>