Compare commits
5 Commits
3d79cab89a
...
feat/intl-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
78cdc7b539 | ||
|
|
6e5d641c06 | ||
|
|
a4be3c5d93 | ||
|
|
b1566348b0 | ||
|
|
a5c28e99e2 |
@@ -61,6 +61,7 @@ jobs:
|
|||||||
|
|
||||||
- name: 🔍 Run ESLint
|
- name: 🔍 Run ESLint
|
||||||
run: npm run lint
|
run: npm run lint
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
- name: 💅 Check code formatting (Prettier)
|
- name: 💅 Check code formatting (Prettier)
|
||||||
run: npm run format:check
|
run: npm run format:check
|
||||||
@@ -93,12 +94,12 @@ jobs:
|
|||||||
echo "Creating .env file for Docker build..."
|
echo "Creating .env file for Docker build..."
|
||||||
cat > .env << EOF
|
cat > .env << EOF
|
||||||
# Build-time environment variables
|
# Build-time environment variables
|
||||||
NEXT_PUBLIC_SITE_URL=${{ secrets.NEXT_PUBLIC_SITE_URL }}
|
NEXT_PUBLIC_SITE_URL=${{ vars.NEXT_PUBLIC_SITE_URL }}
|
||||||
NODE_ENV=production
|
NODE_ENV=production
|
||||||
NEXT_TELEMETRY_DISABLED=1
|
NEXT_TELEMETRY_DISABLED=1
|
||||||
|
|
||||||
# Add other build-time variables here as needed
|
# Add other build-time variables here as needed
|
||||||
# NEXT_PUBLIC_GA_ID=${{ secrets.NEXT_PUBLIC_GA_ID }}
|
# NEXT_PUBLIC_GA_ID=${{ vars.NEXT_PUBLIC_GA_ID }}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
echo "✅ .env file created successfully"
|
echo "✅ .env file created successfully"
|
||||||
|
|||||||
259
app/[locale]/about/page.tsx
Normal file
259
app/[locale]/about/page.tsx
Normal file
@@ -0,0 +1,259 @@
|
|||||||
|
import { Metadata } from 'next'
|
||||||
|
import { Navbar } from '@/components/blog/navbar'
|
||||||
|
import {setRequestLocale} from 'next-intl/server'
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
title: 'About',
|
||||||
|
description: 'Learn more about me and this blog',
|
||||||
|
}
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
params: Promise<{locale: string}>
|
||||||
|
}
|
||||||
|
|
||||||
|
export default async function AboutPage({params}: Props) {
|
||||||
|
const {locale} = await params
|
||||||
|
setRequestLocale(locale)
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Navbar />
|
||||||
|
<div className="min-h-screen bg-[rgb(var(--bg-primary))]">
|
||||||
|
<div className="max-w-4xl mx-auto px-6 py-16">
|
||||||
|
{/* Classification Header */}
|
||||||
|
<div className="border-2 border-[rgb(var(--border-primary))] p-8 mb-10">
|
||||||
|
<p className="text-[rgb(var(--text-muted))] font-mono text-xs uppercase tracking-widest mb-4">
|
||||||
|
>> _DOC://PUBLIC_ACCESS
|
||||||
|
</p>
|
||||||
|
<h1 className="text-4xl md:text-5xl font-mono font-bold uppercase text-[rgb(var(--text-primary))] tracking-tight">
|
||||||
|
ABOUT ME_
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Main Content */}
|
||||||
|
<div className="space-y-8">
|
||||||
|
{/* Introduction Section */}
|
||||||
|
<section className="border-2 border-[rgb(var(--border-primary))] p-8">
|
||||||
|
<div className="border-l-4 border-[var(--neon-cyan)] pl-6">
|
||||||
|
<p className="font-mono text-base text-[rgb(var(--text-primary))] leading-relaxed mb-4">
|
||||||
|
Welcome to my corner of the internet! This is where I share my thoughts, opinions,
|
||||||
|
and experiences - from tech adventures to life as a family man. Yes, I love
|
||||||
|
technology, but there's so much more to life than just code and servers.
|
||||||
|
</p>
|
||||||
|
<p className="font-mono text-sm text-[rgb(var(--text-muted))] uppercase tracking-wider">
|
||||||
|
STATUS: ACTIVE // ROLE: DAD + DEV + LIFE ENTHUSIAST
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
{/* Life & Values Section */}
|
||||||
|
<section className="border-2 border-[rgb(var(--border-primary))] p-8">
|
||||||
|
<h2 className="text-2xl font-mono font-bold uppercase text-[rgb(var(--text-primary))] mb-6 pb-3 border-b-2 border-[rgb(var(--border-primary))]">
|
||||||
|
> LIFE & VALUES
|
||||||
|
</h2>
|
||||||
|
<div className="space-y-4">
|
||||||
|
<div className="border-l-4 border-[var(--neon-pink)] pl-6">
|
||||||
|
<h3 className="font-mono text-sm font-bold text-[var(--neon-pink)] uppercase mb-2">
|
||||||
|
[FAMILY FIRST]
|
||||||
|
</h3>
|
||||||
|
<p className="font-mono text-sm text-[rgb(var(--text-primary))] leading-relaxed">
|
||||||
|
Being a dad to an amazing toddler is my most important role. Family time is
|
||||||
|
sacred - whether it's building block towers, exploring parks, or just
|
||||||
|
enjoying the chaos of everyday life together. Tech can wait; these moments
|
||||||
|
can't.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div className="border-l-4 border-[var(--neon-cyan)] pl-6">
|
||||||
|
<h3 className="font-mono text-sm font-bold text-[var(--neon-cyan)] uppercase mb-2">
|
||||||
|
[ACTIVE LIFESTYLE]
|
||||||
|
</h3>
|
||||||
|
<p className="font-mono text-sm text-[rgb(var(--text-primary))] leading-relaxed">
|
||||||
|
I believe in keeping the body active. Whether it's hitting the gym, playing
|
||||||
|
sports, or just staying on the move - physical activity keeps me sharp,
|
||||||
|
balanced, and ready for whatever life throws my way.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div className="border-l-4 border-[var(--neon-green)] pl-6">
|
||||||
|
<h3 className="font-mono text-sm font-bold text-[var(--neon-green)] uppercase mb-2">
|
||||||
|
[ENJOYING THE SIMPLE THINGS]
|
||||||
|
</h3>
|
||||||
|
<p className="font-mono text-sm text-[rgb(var(--text-primary))] leading-relaxed">
|
||||||
|
Life's too short not to enjoy it. A good drink, a relaxing
|
||||||
|
evening after a long day, or just not doing anything a blowing some steam off.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div className="border-l-4 border-[var(--neon-orange)] pl-6">
|
||||||
|
<h3 className="font-mono text-sm font-bold text-[var(--neon-orange)] uppercase mb-2">
|
||||||
|
[TECH WITH PURPOSE]
|
||||||
|
</h3>
|
||||||
|
<p className="font-mono text-sm text-[rgb(var(--text-primary))] leading-relaxed">
|
||||||
|
Yes, I love tech - self-hosting, privacy, tinkering with hardware. But it's
|
||||||
|
a tool, not a lifestyle. Tech should serve life, not the other way around.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
{/* Content Section */}
|
||||||
|
<section className="border-2 border-[rgb(var(--border-primary))] p-8">
|
||||||
|
<h2 className="text-2xl font-mono font-bold uppercase text-[rgb(var(--text-primary))] mb-6 pb-3 border-b-2 border-[rgb(var(--border-primary))]">
|
||||||
|
> WHAT YOU'LL FIND HERE
|
||||||
|
</h2>
|
||||||
|
<p className="font-mono text-sm text-[rgb(var(--text-muted))] uppercase tracking-wider mb-6">
|
||||||
|
CONTENT SCOPE // EVERYTHING FROM TECH TO LIFE
|
||||||
|
</p>
|
||||||
|
<ul className="space-y-3">
|
||||||
|
<li className="flex items-start gap-3">
|
||||||
|
<span className="text-[var(--neon-pink)] font-mono font-bold">></span>
|
||||||
|
<span className="font-mono text-sm text-[rgb(var(--text-primary))] leading-relaxed">
|
||||||
|
<strong>Thoughts & Opinions</strong> - My take on life, work, and everything in
|
||||||
|
between
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
<li className="flex items-start gap-3">
|
||||||
|
<span className="text-[var(--neon-pink)] font-mono font-bold">></span>
|
||||||
|
<span className="font-mono text-sm text-[rgb(var(--text-primary))] leading-relaxed">
|
||||||
|
<strong>Life & Family</strong> - Adventures in parenting, sports, and enjoying
|
||||||
|
the simple things
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
<li className="flex items-start gap-3">
|
||||||
|
<span className="text-[var(--neon-cyan)] font-mono font-bold">></span>
|
||||||
|
<span className="font-mono text-sm text-[rgb(var(--text-primary))] leading-relaxed">
|
||||||
|
<strong>Tech Research</strong> - When I dive into interesting technologies and
|
||||||
|
experiments
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
<li className="flex items-start gap-3">
|
||||||
|
<span className="text-[var(--neon-cyan)] font-mono font-bold">></span>
|
||||||
|
<span className="font-mono text-sm text-[rgb(var(--text-primary))] leading-relaxed">
|
||||||
|
<strong>System Administration</strong> - Self-hosting, infrastructure, and
|
||||||
|
DevOps adventures
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
<li className="flex items-start gap-3">
|
||||||
|
<span className="text-[var(--neon-cyan)] font-mono font-bold">></span>
|
||||||
|
<span className="font-mono text-sm text-[rgb(var(--text-primary))] leading-relaxed">
|
||||||
|
<strong>Development Insights</strong> - Lessons learned from building software
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
<li className="flex items-start gap-3">
|
||||||
|
<span className="text-[var(--neon-green)] font-mono font-bold">></span>
|
||||||
|
<span className="font-mono text-sm text-[rgb(var(--text-primary))] leading-relaxed">
|
||||||
|
<strong>Random Stuff</strong> - Because life doesn't fit into neat
|
||||||
|
categories!
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
{/* Areas of Focus Section */}
|
||||||
|
<section className="border-2 border-[rgb(var(--border-primary))] p-8">
|
||||||
|
<h2 className="text-2xl font-mono font-bold uppercase text-[rgb(var(--text-primary))] mb-6 pb-3 border-b-2 border-[rgb(var(--border-primary))]">
|
||||||
|
> AREAS OF FOCUS
|
||||||
|
</h2>
|
||||||
|
<div className="grid md:grid-cols-2 gap-4">
|
||||||
|
<div className="border border-[rgb(var(--border-primary))] p-4">
|
||||||
|
<h3 className="font-mono text-xs font-bold text-[var(--neon-pink)] uppercase mb-2">
|
||||||
|
[BEING A DAD]
|
||||||
|
</h3>
|
||||||
|
<p className="font-mono text-xs text-[rgb(var(--text-primary))] leading-relaxed">
|
||||||
|
Playing with my boy, teaching moments, watching him grow, building memories
|
||||||
|
together
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div className="border border-[rgb(var(--border-primary))] p-4">
|
||||||
|
<h3 className="font-mono text-xs font-bold text-[var(--neon-cyan)] uppercase mb-2">
|
||||||
|
[STAYING ACTIVE]
|
||||||
|
</h3>
|
||||||
|
<p className="font-mono text-xs text-[rgb(var(--text-primary))] leading-relaxed">
|
||||||
|
Gym sessions, sports, keeping fit, maintaining energy for life's demands
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div className="border border-[rgb(var(--border-primary))] p-4">
|
||||||
|
<h3 className="font-mono text-xs font-bold text-[var(--neon-green)] uppercase mb-2">
|
||||||
|
[TECHNOLOGY & SYSTEMS]
|
||||||
|
</h3>
|
||||||
|
<p className="font-mono text-xs text-[rgb(var(--text-primary))] leading-relaxed">
|
||||||
|
Software development, infrastructure, DevOps, self-hosting adventures
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div className="border border-[rgb(var(--border-primary))] p-4">
|
||||||
|
<h3 className="font-mono text-xs font-bold text-[var(--neon-orange)] uppercase mb-2">
|
||||||
|
[LIFE BALANCE]
|
||||||
|
</h3>
|
||||||
|
<p className="font-mono text-xs text-[rgb(var(--text-primary))] leading-relaxed">
|
||||||
|
Relaxing with good company, enjoying downtime, appreciating the simple moments
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
{/* Tech Stack Section */}
|
||||||
|
<section className="border-2 border-[rgb(var(--border-primary))] p-8">
|
||||||
|
<h2 className="text-2xl font-mono font-bold uppercase text-[rgb(var(--text-primary))] mb-6 pb-3 border-b-2 border-[rgb(var(--border-primary))]">
|
||||||
|
> TECH STACK
|
||||||
|
</h2>
|
||||||
|
<p className="font-mono text-sm text-[rgb(var(--text-muted))] uppercase tracking-wider mb-6">
|
||||||
|
TOOLS I USE // WHEN NEEDED
|
||||||
|
</p>
|
||||||
|
<div className="grid md:grid-cols-2 gap-4">
|
||||||
|
<div className="border border-[rgb(var(--border-primary))] p-4">
|
||||||
|
<h3 className="font-mono text-xs font-bold text-[var(--neon-cyan)] uppercase mb-2">
|
||||||
|
[DEVELOPMENT]
|
||||||
|
</h3>
|
||||||
|
<p className="font-mono text-xs text-[rgb(var(--text-primary))] leading-relaxed">
|
||||||
|
.NET, Golang, TypeScript, Next.js, React
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div className="border border-[rgb(var(--border-primary))] p-4">
|
||||||
|
<h3 className="font-mono text-xs font-bold text-[var(--neon-cyan)] uppercase mb-2">
|
||||||
|
[INFRASTRUCTURE]
|
||||||
|
</h3>
|
||||||
|
<p className="font-mono text-xs text-[rgb(var(--text-primary))] leading-relaxed">
|
||||||
|
Windows Server, Linux, Docker, Hyper-V
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div className="border border-[rgb(var(--border-primary))] p-4">
|
||||||
|
<h3 className="font-mono text-xs font-bold text-[var(--neon-cyan)] uppercase mb-2">
|
||||||
|
[DESIGN]
|
||||||
|
</h3>
|
||||||
|
<p className="font-mono text-xs text-[rgb(var(--text-primary))] leading-relaxed">
|
||||||
|
Tailwind CSS, Markdown, Terminal aesthetics
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div className="border border-[rgb(var(--border-primary))] p-4">
|
||||||
|
<h3 className="font-mono text-xs font-bold text-[var(--neon-cyan)] uppercase mb-2">
|
||||||
|
[SELF-HOSTING]
|
||||||
|
</h3>
|
||||||
|
<p className="font-mono text-xs text-[rgb(var(--text-primary))] leading-relaxed">
|
||||||
|
Home lab, privacy-focused services, full control, Git server
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
{/* Contact Section */}
|
||||||
|
<section className="border-2 border-[rgb(var(--border-primary))] p-8">
|
||||||
|
<h2 className="text-2xl font-mono font-bold uppercase text-[rgb(var(--text-primary))] mb-6 pb-3 border-b-2 border-[rgb(var(--border-primary))]">
|
||||||
|
> CONTACT
|
||||||
|
</h2>
|
||||||
|
<div className="border-l-4 border-[var(--neon-pink)] pl-6">
|
||||||
|
{/* <p className="font-mono text-sm text-[rgb(var(--text-primary))] leading-relaxed mb-4">
|
||||||
|
You can reach me at{' '}
|
||||||
|
<a
|
||||||
|
href="mailto:email@example.com"
|
||||||
|
className="text-[var(--neon-cyan)] hover:text-[var(--neon-pink)] underline transition-colors"
|
||||||
|
>
|
||||||
|
email@example.com
|
||||||
|
</a>{' '}
|
||||||
|
or find me on social media.
|
||||||
|
</p> */}
|
||||||
|
{/* <p className="font-mono text-xs text-[rgb(var(--text-muted))] uppercase tracking-wider">
|
||||||
|
RESPONSE TIME: < 24H // STATUS: MONITORED
|
||||||
|
</p> */}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -1,26 +1,29 @@
|
|||||||
import Link from 'next/link'
|
import { useTranslations } from 'next-intl'
|
||||||
|
import { Link } from '@/i18n/navigation'
|
||||||
|
|
||||||
export default function NotFound() {
|
export default function NotFound() {
|
||||||
|
const t = useTranslations('NotFound')
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="min-h-[60vh] flex items-center justify-center">
|
<div className="min-h-[60vh] flex items-center justify-center">
|
||||||
<div className="text-center">
|
<div className="text-center">
|
||||||
<h1 className="text-6xl font-bold text-gray-300 dark:text-gray-700 mb-4">404</h1>
|
<h1 className="text-6xl font-bold text-gray-300 dark:text-gray-700 mb-4">404</h1>
|
||||||
<h2 className="text-2xl font-semibold mb-4">Articolul nu a fost găsit</h2>
|
<h2 className="text-2xl font-semibold mb-4">{t('title')}</h2>
|
||||||
<p className="text-gray-600 dark:text-gray-400 mb-8">
|
<p className="text-gray-600 dark:text-gray-400 mb-8">
|
||||||
Ne pare rău, dar articolul pe care îl cauți nu există sau a fost mutat.
|
{t('description')}
|
||||||
</p>
|
</p>
|
||||||
<div className="space-x-4">
|
<div className="space-x-4">
|
||||||
<Link
|
<Link
|
||||||
href="/blog"
|
href="/blog"
|
||||||
className="inline-block px-6 py-3 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition"
|
className="inline-block px-6 py-3 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition"
|
||||||
>
|
>
|
||||||
Vezi toate articolele
|
{t('goHome')}
|
||||||
</Link>
|
</Link>
|
||||||
<Link
|
<Link
|
||||||
href="/"
|
href="/"
|
||||||
className="inline-block px-6 py-3 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-800 transition"
|
className="inline-block px-6 py-3 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-800 transition"
|
||||||
>
|
>
|
||||||
Pagina principală
|
{t('goHome')}
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1,26 +1,36 @@
|
|||||||
import { Metadata } from 'next'
|
import { Metadata } from 'next'
|
||||||
import { notFound } from 'next/navigation'
|
import { notFound } from 'next/navigation'
|
||||||
import Link from 'next/link'
|
import { Link } from '@/src/i18n/navigation'
|
||||||
import { getAllPosts, getPostBySlug, getRelatedPosts } from '@/lib/markdown'
|
import { getAllPosts, getPostBySlug, getRelatedPosts } from '@/lib/markdown'
|
||||||
import { formatDate, formatRelativeDate } from '@/lib/utils'
|
import { formatDate, formatRelativeDate } from '@/lib/utils'
|
||||||
import { TableOfContents } from '@/components/blog/table-of-contents'
|
import { TableOfContents } from '@/components/blog/table-of-contents'
|
||||||
import { ReadingProgress } from '@/components/blog/reading-progress'
|
import { ReadingProgress } from '@/components/blog/reading-progress'
|
||||||
import { StickyFooter } from '@/components/blog/sticky-footer'
|
import { StickyFooter } from '@/components/blog/sticky-footer'
|
||||||
import MarkdownRenderer from '@/components/blog/markdown-renderer'
|
import MarkdownRenderer from '@/components/blog/markdown-renderer'
|
||||||
|
import { setRequestLocale } from 'next-intl/server'
|
||||||
|
import { routing } from '@/src/i18n/routing'
|
||||||
|
|
||||||
export async function generateStaticParams() {
|
export async function generateStaticParams() {
|
||||||
const posts = await getAllPosts()
|
const locales = ['en', 'ro']
|
||||||
return posts.map(post => ({ slug: post.slug.split('/') }))
|
const allParams: Array<{ locale: string; slug: string[] }> = []
|
||||||
|
|
||||||
|
for (const locale of locales) {
|
||||||
|
const posts = await getAllPosts(locale)
|
||||||
|
posts.forEach(post => {
|
||||||
|
allParams.push({ locale, slug: post.slug.split('/') })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return allParams
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function generateMetadata({
|
export async function generateMetadata({
|
||||||
params,
|
params,
|
||||||
}: {
|
}: {
|
||||||
params: Promise<{ slug: string[] }>
|
params: Promise<{ locale: string; slug: string[] }>
|
||||||
}): Promise<Metadata> {
|
}): Promise<Metadata> {
|
||||||
const { slug } = await params
|
const { slug, locale } = await params
|
||||||
const slugPath = slug.join('/')
|
const slugPath = slug.join('/')
|
||||||
const post = await getPostBySlug(slugPath)
|
const post = await getPostBySlug(slugPath, locale)
|
||||||
|
|
||||||
if (!post) {
|
if (!post) {
|
||||||
return { title: 'Articol negăsit' }
|
return { title: 'Articol negăsit' }
|
||||||
@@ -65,10 +75,14 @@ function extractHeadings(content: string) {
|
|||||||
return headings
|
return headings
|
||||||
}
|
}
|
||||||
|
|
||||||
export default async function BlogPostPage({ params }: { params: Promise<{ slug: string[] }> }) {
|
export default async function BlogPostPage({
|
||||||
const { slug } = await params
|
params,
|
||||||
|
}: {
|
||||||
|
params: Promise<{ locale: string; slug: string[] }>
|
||||||
|
}) {
|
||||||
|
const { slug, locale } = await params
|
||||||
const slugPath = slug.join('/')
|
const slugPath = slug.join('/')
|
||||||
const post = await getPostBySlug(slugPath)
|
const post = await getPostBySlug(slugPath, locale)
|
||||||
|
|
||||||
if (!post) {
|
if (!post) {
|
||||||
notFound()
|
notFound()
|
||||||
@@ -91,7 +105,7 @@ export default async function BlogPostPage({ params }: { params: Promise<{ slug:
|
|||||||
<div className="border-b border-[var(--neon-pink)] pb-4 mb-6 relative">
|
<div className="border-b border-[var(--neon-pink)] pb-4 mb-6 relative">
|
||||||
<div className="flex items-center gap-3 mb-3 justify-end">
|
<div className="flex items-center gap-3 mb-3 justify-end">
|
||||||
<p className="font-mono text-xs text-[var(--neon-cyan)] uppercase tracking-widest">
|
<p className="font-mono text-xs text-[var(--neon-cyan)] uppercase tracking-widest">
|
||||||
>> CLASSIFIED_DOC://PUBLIC_ACCESS
|
>> _DOC://PUBLIC_ACCESS
|
||||||
</p>
|
</p>
|
||||||
<div className="flex gap-1.5">
|
<div className="flex gap-1.5">
|
||||||
<div className="w-4 h-4 border border-[rgb(var(--border-primary))] hover:bg-red-500/10 cursor-pointer" />
|
<div className="w-4 h-4 border border-[rgb(var(--border-primary))] hover:bg-red-500/10 cursor-pointer" />
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { useMemo, useState } from 'react'
|
import { useMemo, useState } from 'react'
|
||||||
|
import { useTranslations } from 'next-intl'
|
||||||
import { Post } from '@/lib/types/frontmatter'
|
import { Post } from '@/lib/types/frontmatter'
|
||||||
import { BlogCard } from '@/components/blog/blog-card'
|
import { BlogCard } from '@/components/blog/blog-card'
|
||||||
import { SearchBar } from '@/components/blog/search-bar'
|
import { SearchBar } from '@/components/blog/search-bar'
|
||||||
@@ -16,6 +17,7 @@ interface BlogPageClientProps {
|
|||||||
type SortOption = 'newest' | 'oldest' | 'title'
|
type SortOption = 'newest' | 'oldest' | 'title'
|
||||||
|
|
||||||
export default function BlogPageClient({ posts, allTags }: BlogPageClientProps) {
|
export default function BlogPageClient({ posts, allTags }: BlogPageClientProps) {
|
||||||
|
const t = useTranslations('BlogListing')
|
||||||
const [searchQuery, setSearchQuery] = useState('')
|
const [searchQuery, setSearchQuery] = useState('')
|
||||||
const [selectedTags, setSelectedTags] = useState<string[]>([])
|
const [selectedTags, setSelectedTags] = useState<string[]>([])
|
||||||
const [sortBy, setSortBy] = useState<SortOption>('newest')
|
const [sortBy, setSortBy] = useState<SortOption>('newest')
|
||||||
@@ -67,10 +69,10 @@ export default function BlogPageClient({ posts, allTags }: BlogPageClientProps)
|
|||||||
{/* Header */}
|
{/* Header */}
|
||||||
<div className="border-l border-[var(--neon-cyan)] pl-6 mb-12">
|
<div className="border-l border-[var(--neon-cyan)] pl-6 mb-12">
|
||||||
<p className="font-mono text-xs text-[rgb(var(--text-muted))] uppercase tracking-widest mb-2">
|
<p className="font-mono text-xs text-[rgb(var(--text-muted))] uppercase tracking-widest mb-2">
|
||||||
DATABASE QUERY // SEARCH RESULTS
|
{t("subtitle")}
|
||||||
</p>
|
</p>
|
||||||
<h1 className="text-4xl md:text-6xl font-mono font-bold text-[rgb(var(--text-primary))] uppercase tracking-tight">
|
<h1 className="text-4xl md:text-6xl font-mono font-bold text-[rgb(var(--text-primary))] uppercase tracking-tight">
|
||||||
> BLOG ARCHIVE_
|
> {t("title")}_
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -102,8 +104,8 @@ export default function BlogPageClient({ posts, allTags }: BlogPageClientProps)
|
|||||||
{/* Results Count */}
|
{/* Results Count */}
|
||||||
<div className="mb-6">
|
<div className="mb-6">
|
||||||
<p className="font-mono text-sm text-[rgb(var(--text-muted))] uppercase">
|
<p className="font-mono text-sm text-[rgb(var(--text-muted))] uppercase">
|
||||||
FOUND {filteredAndSortedPosts.length}{' '}
|
{t("foundPosts", {count: filteredAndSortedPosts.length})}{' '}
|
||||||
{filteredAndSortedPosts.length === 1 ? 'POST' : 'POSTS'}
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -126,7 +128,7 @@ export default function BlogPageClient({ posts, allTags }: BlogPageClientProps)
|
|||||||
) : (
|
) : (
|
||||||
<div className="border border-[rgb(var(--border-primary))] bg-[rgb(var(--bg-secondary))] p-12 text-center">
|
<div className="border border-[rgb(var(--border-primary))] bg-[rgb(var(--bg-secondary))] p-12 text-center">
|
||||||
<p className="font-mono text-lg text-[rgb(var(--text-muted))] uppercase">
|
<p className="font-mono text-lg text-[rgb(var(--text-muted))] uppercase">
|
||||||
NO POSTS FOUND // TRY DIFFERENT SEARCH TERMS
|
{t("noPosts")}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import { getAllPosts } from '@/lib/markdown'
|
import { getAllPosts } from '@/lib/markdown'
|
||||||
import BlogPageClient from './blog-client'
|
import BlogPageClient from './blog-client'
|
||||||
|
import {setRequestLocale} from 'next-intl/server'
|
||||||
|
|
||||||
export default async function BlogPage() {
|
export default async function BlogPage() {
|
||||||
const posts = await getAllPosts()
|
const posts = await getAllPosts()
|
||||||
35
app/[locale]/layout.tsx
Normal file
35
app/[locale]/layout.tsx
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
import {notFound} from 'next/navigation'
|
||||||
|
import {setRequestLocale} from 'next-intl/server'
|
||||||
|
import {routing} from '@/src/i18n/routing'
|
||||||
|
import {ReactNode} from 'react'
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
children: ReactNode
|
||||||
|
breadcrumbs: ReactNode
|
||||||
|
params: Promise<{locale: string}>
|
||||||
|
}
|
||||||
|
|
||||||
|
export function generateStaticParams() {
|
||||||
|
return routing.locales.map((locale) => ({locale}))
|
||||||
|
}
|
||||||
|
|
||||||
|
export default async function LocaleLayout({
|
||||||
|
children,
|
||||||
|
breadcrumbs,
|
||||||
|
params
|
||||||
|
}: Props) {
|
||||||
|
const {locale} = await params
|
||||||
|
|
||||||
|
if (!routing.locales.includes(locale as any)) {
|
||||||
|
notFound()
|
||||||
|
}
|
||||||
|
|
||||||
|
setRequestLocale(locale)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{breadcrumbs}
|
||||||
|
<main>{children}</main>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
import Link from 'next/link'
|
import {Link} from '@/src/i18n/navigation'
|
||||||
import Image from 'next/image'
|
import Image from 'next/image'
|
||||||
import { getAllPosts } from '@/lib/markdown'
|
import { getAllPosts } from '@/lib/markdown'
|
||||||
import { formatDate } from '@/lib/utils'
|
import { formatDate } from '@/lib/utils'
|
||||||
import { ThemeToggle } from '@/components/theme-toggle'
|
import { ThemeToggle } from '@/components/theme-toggle'
|
||||||
|
import {setRequestLocale} from 'next-intl/server'
|
||||||
|
|
||||||
export default async function HomePage() {
|
export default async function HomePage() {
|
||||||
const allPosts = await getAllPosts()
|
const allPosts = await getAllPosts()
|
||||||
@@ -45,7 +46,7 @@ export default async function HomePage() {
|
|||||||
|
|
||||||
<div className="border-l-4 border-cyan-700 dark:border-cyan-900 pl-6 mb-8">
|
<div className="border-l-4 border-cyan-700 dark:border-cyan-900 pl-6 mb-8">
|
||||||
<p className="font-mono text-xs text-slate-500 dark:text-slate-500 uppercase tracking-widest mb-2">
|
<p className="font-mono text-xs text-slate-500 dark:text-slate-500 uppercase tracking-widest mb-2">
|
||||||
DOCUMENT LEVEL-1 // CLASSIFIED
|
DOCUMENT LEVEL-1 //
|
||||||
</p>
|
</p>
|
||||||
<h1 className="text-4xl md:text-6xl lg:text-7xl font-mono font-bold text-slate-900 dark:text-slate-100 uppercase tracking-tight mb-6">
|
<h1 className="text-4xl md:text-6xl lg:text-7xl font-mono font-bold text-slate-900 dark:text-slate-100 uppercase tracking-tight mb-6">
|
||||||
BUILD. WRITE.
|
BUILD. WRITE.
|
||||||
@@ -53,7 +54,7 @@ export default async function HomePage() {
|
|||||||
SHARE.
|
SHARE.
|
||||||
</h1>
|
</h1>
|
||||||
<p className="text-base md:text-lg lg:text-xl text-slate-700 dark:text-slate-400 font-mono leading-relaxed max-w-2xl">
|
<p className="text-base md:text-lg lg:text-xl text-slate-700 dark:text-slate-400 font-mono leading-relaxed max-w-2xl">
|
||||||
> Explorează idei despre dezvoltare, design și tehnologie_
|
> Explore ideas
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -62,13 +63,13 @@ export default async function HomePage() {
|
|||||||
href="/blog"
|
href="/blog"
|
||||||
className="px-6 md:px-8 py-3 md:py-4 bg-cyan-700 dark:bg-cyan-900 text-white dark:text-slate-100 border-2 border-cyan-600 dark:border-cyan-700 font-mono font-bold uppercase text-xs md:text-sm tracking-wider hover:bg-cyan-600 dark:hover:bg-cyan-800 hover:border-cyan-500 dark:hover:border-cyan-600 rounded-none transition-colors duration-200"
|
className="px-6 md:px-8 py-3 md:py-4 bg-cyan-700 dark:bg-cyan-900 text-white dark:text-slate-100 border-2 border-cyan-600 dark:border-cyan-700 font-mono font-bold uppercase text-xs md:text-sm tracking-wider hover:bg-cyan-600 dark:hover:bg-cyan-800 hover:border-cyan-500 dark:hover:border-cyan-600 rounded-none transition-colors duration-200"
|
||||||
>
|
>
|
||||||
[EXPLOREAZĂ BLOG]
|
[CHECK POSTS]
|
||||||
</Link>
|
</Link>
|
||||||
<Link
|
<Link
|
||||||
href="/about"
|
href="/about"
|
||||||
className="px-6 md:px-8 py-3 md:py-4 bg-transparent text-slate-700 dark:text-slate-300 border-2 border-slate-400 dark:border-slate-700 font-mono font-bold uppercase text-xs md:text-sm tracking-wider hover:bg-slate-200 dark:hover:bg-slate-800 hover:border-slate-500 dark:hover:border-slate-600 rounded-none transition-colors duration-200"
|
className="px-6 md:px-8 py-3 md:py-4 bg-transparent text-slate-700 dark:text-slate-300 border-2 border-slate-400 dark:border-slate-700 font-mono font-bold uppercase text-xs md:text-sm tracking-wider hover:bg-slate-200 dark:hover:bg-slate-800 hover:border-slate-500 dark:hover:border-slate-600 rounded-none transition-colors duration-200"
|
||||||
>
|
>
|
||||||
[DESPRE MINE]
|
[ABOUT ME]
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -83,7 +84,7 @@ export default async function HomePage() {
|
|||||||
ARCHIVE ACCESS // RECENT ENTRIES
|
ARCHIVE ACCESS // RECENT ENTRIES
|
||||||
</p>
|
</p>
|
||||||
<h2 className="text-3xl md:text-5xl font-mono font-bold text-slate-900 dark:text-slate-100 uppercase tracking-tight">
|
<h2 className="text-3xl md:text-5xl font-mono font-bold text-slate-900 dark:text-slate-100 uppercase tracking-tight">
|
||||||
> POSTĂRI RECENTE_
|
> RECENT ENTRIES
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -146,28 +147,28 @@ export default async function HomePage() {
|
|||||||
href="/blog"
|
href="/blog"
|
||||||
className="inline-flex items-center px-8 py-4 bg-transparent text-slate-700 dark:text-slate-300 border-2 border-slate-400 dark:border-slate-700 font-mono font-bold uppercase text-sm tracking-wider hover:bg-slate-200 dark:hover:bg-slate-800 hover:border-slate-500 dark:hover:border-slate-600 transition-colors duration-200"
|
className="inline-flex items-center px-8 py-4 bg-transparent text-slate-700 dark:text-slate-300 border-2 border-slate-400 dark:border-slate-700 font-mono font-bold uppercase text-sm tracking-wider hover:bg-slate-200 dark:hover:bg-slate-800 hover:border-slate-500 dark:hover:border-slate-600 transition-colors duration-200"
|
||||||
>
|
>
|
||||||
[VEZI TOATE ARTICOLELE] >>
|
[SEE POSTS] >>
|
||||||
</Link>
|
</Link>
|
||||||
)}
|
)}
|
||||||
<Link
|
<Link
|
||||||
href="/tags"
|
href="/tags"
|
||||||
className="inline-flex items-center px-8 py-4 bg-transparent text-slate-700 dark:text-slate-300 border-2 border-slate-400 dark:border-slate-700 font-mono font-bold uppercase text-sm tracking-wider hover:bg-slate-200 dark:hover:bg-slate-800 hover:border-slate-500 dark:hover:border-slate-600 transition-colors duration-200"
|
className="inline-flex items-center px-8 py-4 bg-transparent text-slate-700 dark:text-slate-300 border-2 border-slate-400 dark:border-slate-700 font-mono font-bold uppercase text-sm tracking-wider hover:bg-slate-200 dark:hover:bg-slate-800 hover:border-slate-500 dark:hover:border-slate-600 transition-colors duration-200"
|
||||||
>
|
>
|
||||||
[VEZI TOATE TAG-URILE] >>
|
[SEE ALL TAGS] >>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{/* Stats Section - from worktree-agent-1 */}
|
{/* Stats Section - from worktree-agent-1 */}
|
||||||
<section className="py-24 bg-zinc-50 dark:bg-zinc-900 border-y-4 border-slate-300 dark:border-slate-800 transition-colors duration-300">
|
{/* <section className="py-24 bg-zinc-50 dark:bg-zinc-900 border-y-4 border-slate-300 dark:border-slate-800 transition-colors duration-300">
|
||||||
<div className="max-w-7xl mx-auto px-6">
|
<div className="max-w-7xl mx-auto px-6">
|
||||||
<div className="border-l-4 border-teal-700 dark:border-teal-900 pl-6 mb-12">
|
<div className="border-l-4 border-teal-700 dark:border-teal-900 pl-6 mb-12">
|
||||||
<p className="font-mono text-xs text-slate-500 dark:text-slate-500 uppercase tracking-widest mb-2">
|
<p className="font-mono text-xs text-slate-500 dark:text-slate-500 uppercase tracking-widest mb-2">
|
||||||
SYSTEM STATISTICS // DATABASE METRICS
|
SYSTEM STATISTICS // DATABASE METRICS
|
||||||
</p>
|
</p>
|
||||||
<h2 className="text-3xl md:text-5xl font-mono font-bold text-slate-900 dark:text-slate-100 uppercase tracking-tight">
|
<h2 className="text-3xl md:text-5xl font-mono font-bold text-slate-900 dark:text-slate-100 uppercase tracking-tight">
|
||||||
> METRICI_
|
> METRICS
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -177,7 +178,7 @@ export default async function HomePage() {
|
|||||||
{allPosts.length}+
|
{allPosts.length}+
|
||||||
</div>
|
</div>
|
||||||
<p className="text-slate-600 dark:text-slate-400 font-mono text-sm uppercase tracking-wider border-t-2 border-slate-300 dark:border-slate-800 pt-4">
|
<p className="text-slate-600 dark:text-slate-400 font-mono text-sm uppercase tracking-wider border-t-2 border-slate-300 dark:border-slate-800 pt-4">
|
||||||
ARTICOLE PUBLICATE
|
PUBLISHED
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -200,10 +201,10 @@ export default async function HomePage() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section> */}
|
||||||
|
|
||||||
{/* Newsletter CTA - from worktree-agent-1 */}
|
{/* Newsletter CTA - from worktree-agent-1 */}
|
||||||
<section className="py-24 bg-zinc-100 dark:bg-slate-900 border-t-4 border-slate-300 dark:border-slate-800 transition-colors duration-300">
|
{/* <section className="py-24 bg-zinc-100 dark:bg-slate-900 border-t-4 border-slate-300 dark:border-slate-800 transition-colors duration-300">
|
||||||
<div className="max-w-3xl mx-auto px-6">
|
<div className="max-w-3xl mx-auto px-6">
|
||||||
<div className="border-4 border-slate-300 dark:border-slate-700 bg-white dark:bg-zinc-900 p-12 transition-colors duration-300">
|
<div className="border-4 border-slate-300 dark:border-slate-700 bg-white dark:bg-zinc-900 p-12 transition-colors duration-300">
|
||||||
<p className="font-mono text-xs text-slate-500 dark:text-slate-500 uppercase tracking-widest mb-2">
|
<p className="font-mono text-xs text-slate-500 dark:text-slate-500 uppercase tracking-widest mb-2">
|
||||||
@@ -233,7 +234,7 @@ export default async function HomePage() {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section> */}
|
||||||
</main>
|
</main>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
import { Metadata } from 'next'
|
import { Metadata } from 'next'
|
||||||
import { notFound } from 'next/navigation'
|
import { notFound } from 'next/navigation'
|
||||||
import Link from 'next/link'
|
import {Link} from '@/src/i18n/navigation'
|
||||||
import { getAllTags, getPostsByTag, getTagInfo, getRelatedTags } from '@/lib/tags'
|
import { getAllTags, getPostsByTag, getTagInfo, getRelatedTags } from '@/lib/tags'
|
||||||
import { TagList } from '@/components/blog/tag-list'
|
import { TagList } from '@/components/blog/tag-list'
|
||||||
import { formatDate } from '@/lib/utils'
|
import { formatDate } from '@/lib/utils'
|
||||||
|
import {setRequestLocale} from 'next-intl/server'
|
||||||
|
import {routing} from '@/src/i18n/routing'
|
||||||
|
|
||||||
export async function generateStaticParams() {
|
export async function generateStaticParams() {
|
||||||
const tags = await getAllTags()
|
const tags = await getAllTags()
|
||||||
@@ -13,7 +15,7 @@ export async function generateStaticParams() {
|
|||||||
export async function generateMetadata({
|
export async function generateMetadata({
|
||||||
params,
|
params,
|
||||||
}: {
|
}: {
|
||||||
params: Promise<{ tag: string }>
|
params: Promise<{ locale: string; tag: string }>
|
||||||
}): Promise<Metadata> {
|
}): Promise<Metadata> {
|
||||||
const { tag } = await params
|
const { tag } = await params
|
||||||
const tagInfo = await getTagInfo(tag)
|
const tagInfo = await getTagInfo(tag)
|
||||||
@@ -1,15 +1,22 @@
|
|||||||
import { Metadata } from 'next'
|
import { Metadata } from 'next'
|
||||||
import Link from 'next/link'
|
import {Link} from '@/src/i18n/navigation'
|
||||||
import { getAllTags, getTagCloud } from '@/lib/tags'
|
import { getAllTags, getTagCloud } from '@/lib/tags'
|
||||||
import { TagCloud } from '@/components/blog/tag-cloud'
|
import { TagCloud } from '@/components/blog/tag-cloud'
|
||||||
import { TagBadge } from '@/components/blog/tag-badge'
|
import { TagBadge } from '@/components/blog/tag-badge'
|
||||||
|
import {setRequestLocale} from 'next-intl/server'
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: 'Tag-uri',
|
title: 'Tag-uri',
|
||||||
description: 'Explorează articolele după tag-uri',
|
description: 'Explorează articolele după tag-uri',
|
||||||
}
|
}
|
||||||
|
|
||||||
export default async function TagsPage() {
|
type Props = {
|
||||||
|
params: Promise<{locale: string}>
|
||||||
|
}
|
||||||
|
|
||||||
|
export default async function TagsPage({params}: Props) {
|
||||||
|
const {locale} = await params
|
||||||
|
setRequestLocale(locale)
|
||||||
const allTags = await getAllTags()
|
const allTags = await getAllTags()
|
||||||
const tagCloud = await getTagCloud()
|
const tagCloud = await getTagCloud()
|
||||||
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
import { Metadata } from 'next'
|
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
|
||||||
title: 'Despre',
|
|
||||||
description: 'Află mai multe despre mine și acest blog',
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function AboutPage() {
|
|
||||||
return (
|
|
||||||
<div className="max-w-3xl mx-auto">
|
|
||||||
<h1 className="text-4xl font-bold mb-8">Despre Mine</h1>
|
|
||||||
|
|
||||||
<div className="prose dark:prose-invert max-w-none">
|
|
||||||
<p className="text-lg leading-relaxed mb-6">
|
|
||||||
Bun venit pe blogul meu! Sunt un dezvoltator pasionat de tehnologie, specializat în
|
|
||||||
dezvoltarea web modernă cu Next.js, React și TypeScript.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2 className="text-2xl font-semibold mt-8 mb-4">Ce vei găsi aici</h2>
|
|
||||||
<ul className="space-y-2">
|
|
||||||
<li>Tutoriale despre dezvoltare web</li>
|
|
||||||
<li>Ghiduri practice pentru Next.js și React</li>
|
|
||||||
<li>Sfaturi despre design și UX</li>
|
|
||||||
<li>Experiențe din proiecte reale</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<h2 className="text-2xl font-semibold mt-8 mb-4">Tehnologii folosite</h2>
|
|
||||||
<p>Acest blog este construit cu:</p>
|
|
||||||
<ul className="space-y-2">
|
|
||||||
<li>
|
|
||||||
<strong>Next.js 15</strong> - Framework React pentru producție
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<strong>TypeScript</strong> - Pentru type safety
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<strong>Tailwind CSS</strong> - Pentru stilizare rapidă
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<strong>Markdown</strong> - Pentru conținut
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<h2 className="text-2xl font-semibold mt-8 mb-4">Contact</h2>
|
|
||||||
<p>
|
|
||||||
Mă poți contacta pe{' '}
|
|
||||||
<a href="mailto:email@example.com" className="text-primary-600 hover:text-primary-700">
|
|
||||||
email@example.com
|
|
||||||
</a>{' '}
|
|
||||||
sau mă poți găsi pe rețelele sociale.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@@ -3,7 +3,7 @@ import { NextResponse } from 'next/server'
|
|||||||
|
|
||||||
export async function GET() {
|
export async function GET() {
|
||||||
const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || 'http://localhost:3030'
|
const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || 'http://localhost:3030'
|
||||||
const posts = await getAllPosts(false)
|
const posts = await getAllPosts("en", false)
|
||||||
|
|
||||||
const rss = `<?xml version="1.0" encoding="UTF-8"?>
|
const rss = `<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
--text-muted: 113 113 122;
|
--text-muted: 113 113 122;
|
||||||
--border-primary: 212 212 216;
|
--border-primary: 212 212 216;
|
||||||
--border-subtle: 228 228 231;
|
--border-subtle: 228 228 231;
|
||||||
|
--text-color: #1f1f1f;
|
||||||
|
|
||||||
/* Desaturated cyberpunk for light mode - darker for readability */
|
/* Desaturated cyberpunk for light mode - darker for readability */
|
||||||
--neon-pink: #7a3d52;
|
--neon-pink: #7a3d52;
|
||||||
@@ -35,6 +36,7 @@
|
|||||||
--text-muted: 100 116 139;
|
--text-muted: 100 116 139;
|
||||||
--border-primary: 71 85 105;
|
--border-primary: 71 85 105;
|
||||||
--border-subtle: 30 41 59;
|
--border-subtle: 30 41 59;
|
||||||
|
--text-color: #d4d4d8;
|
||||||
|
|
||||||
/* Desaturated cyberpunk for dark mode */
|
/* Desaturated cyberpunk for dark mode */
|
||||||
--neon-pink: #8a5568;
|
--neon-pink: #8a5568;
|
||||||
@@ -45,6 +47,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@layer utilities {
|
@layer utilities {
|
||||||
|
/* Scrollbar hiding utility */
|
||||||
.scrollbar-hide {
|
.scrollbar-hide {
|
||||||
-ms-overflow-style: none;
|
-ms-overflow-style: none;
|
||||||
scrollbar-width: none;
|
scrollbar-width: none;
|
||||||
@@ -129,6 +132,7 @@
|
|||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Consolidated keyframes to avoid duplication */
|
||||||
@keyframes glitch-1 {
|
@keyframes glitch-1 {
|
||||||
0%,
|
0%,
|
||||||
100% {
|
100% {
|
||||||
@@ -211,46 +215,6 @@
|
|||||||
clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
|
clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes glitch-1 {
|
|
||||||
0%,
|
|
||||||
100% {
|
|
||||||
transform: translate(0, 0);
|
|
||||||
clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
|
|
||||||
}
|
|
||||||
25% {
|
|
||||||
transform: translate(-3px, 2px);
|
|
||||||
clip-path: polygon(0 10%, 100% 10%, 100% 45%, 0 45%);
|
|
||||||
}
|
|
||||||
50% {
|
|
||||||
transform: translate(3px, -2px);
|
|
||||||
clip-path: polygon(0 20%, 100% 20%, 100% 55%, 0 55%);
|
|
||||||
}
|
|
||||||
75% {
|
|
||||||
transform: translate(-2px, -1px);
|
|
||||||
clip-path: polygon(0 5%, 100% 5%, 100% 40%, 0 40%);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes glitch-2 {
|
|
||||||
0%,
|
|
||||||
100% {
|
|
||||||
transform: translate(0, 0);
|
|
||||||
clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
|
|
||||||
}
|
|
||||||
25% {
|
|
||||||
transform: translate(3px, -2px);
|
|
||||||
clip-path: polygon(0 55%, 100% 55%, 100% 90%, 0 90%);
|
|
||||||
}
|
|
||||||
50% {
|
|
||||||
transform: translate(-3px, 2px);
|
|
||||||
clip-path: polygon(0 45%, 100% 45%, 100% 80%, 0 80%);
|
|
||||||
}
|
|
||||||
75% {
|
|
||||||
transform: translate(2px, 1px);
|
|
||||||
clip-path: polygon(0 60%, 100% 60%, 100% 95%, 0 95%);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Border Pulse Animation */
|
/* Border Pulse Animation */
|
||||||
.border-pulse {
|
.border-pulse {
|
||||||
animation: pulse-border 2s ease-in-out infinite;
|
animation: pulse-border 2s ease-in-out infinite;
|
||||||
@@ -351,7 +315,7 @@
|
|||||||
|
|
||||||
/* Cyberpunk Prose Styling */
|
/* Cyberpunk Prose Styling */
|
||||||
.cyberpunk-prose {
|
.cyberpunk-prose {
|
||||||
color: rgb(212 212 216);
|
color: var(--text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.cyberpunk-prose h1,
|
.cyberpunk-prose h1,
|
||||||
@@ -385,7 +349,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.cyberpunk-prose p {
|
.cyberpunk-prose p {
|
||||||
color: rgb(212 212 216);
|
|
||||||
line-height: 1.625;
|
line-height: 1.625;
|
||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
font-size: 1.125rem;
|
font-size: 1.125rem;
|
||||||
@@ -404,7 +367,6 @@
|
|||||||
|
|
||||||
.cyberpunk-prose ul,
|
.cyberpunk-prose ul,
|
||||||
.cyberpunk-prose ol {
|
.cyberpunk-prose ol {
|
||||||
color: rgb(212 212 216);
|
|
||||||
padding-left: 1.5rem;
|
padding-left: 1.5rem;
|
||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
}
|
}
|
||||||
@@ -475,10 +437,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.cyberpunk-prose img {
|
.cyberpunk-prose img {
|
||||||
margin-top: 2rem;
|
margin: 2rem;
|
||||||
margin-bottom: 2rem;
|
/* border: 4px solid var(--neon-pink); */
|
||||||
border: 4px solid var(--neon-pink);
|
box-shadow: 0 0 2px rgba(155, 90, 110, 0.5);
|
||||||
box-shadow: 0 0 20px rgba(155, 90, 110, 0.5);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.cyberpunk-prose hr {
|
.cyberpunk-prose hr {
|
||||||
|
|||||||
@@ -2,7 +2,9 @@ import type { Metadata } from 'next'
|
|||||||
import { JetBrains_Mono } from 'next/font/google'
|
import { JetBrains_Mono } from 'next/font/google'
|
||||||
import './globals.css'
|
import './globals.css'
|
||||||
import { ThemeProvider } from '@/providers/providers'
|
import { ThemeProvider } from '@/providers/providers'
|
||||||
import '@/lib/env-validation' // Validate environment variables
|
import '@/lib/env-validation'
|
||||||
|
import {NextIntlClientProvider} from 'next-intl'
|
||||||
|
import {getMessages} from 'next-intl/server'
|
||||||
|
|
||||||
const jetbrainsMono = JetBrains_Mono({ subsets: ['latin'], variable: '--font-mono' })
|
const jetbrainsMono = JetBrains_Mono({ subsets: ['latin'], variable: '--font-mono' })
|
||||||
|
|
||||||
@@ -17,7 +19,6 @@ export const metadata: Metadata = {
|
|||||||
keywords: ['blog', 'dezvoltare web', 'nextjs', 'react', 'typescript', 'terminal'],
|
keywords: ['blog', 'dezvoltare web', 'nextjs', 'react', 'typescript', 'terminal'],
|
||||||
openGraph: {
|
openGraph: {
|
||||||
type: 'website',
|
type: 'website',
|
||||||
locale: 'ro_RO',
|
|
||||||
siteName: 'Terminal Blog',
|
siteName: 'Terminal Blog',
|
||||||
},
|
},
|
||||||
robots: {
|
robots: {
|
||||||
@@ -29,9 +30,15 @@ export const metadata: Metadata = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
export default async function RootLayout({
|
||||||
|
children
|
||||||
|
}: {
|
||||||
|
children: React.ReactNode
|
||||||
|
}) {
|
||||||
|
const messages = await getMessages()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<html lang="ro" suppressHydrationWarning className={jetbrainsMono.variable}>
|
<html suppressHydrationWarning className={jetbrainsMono.variable}>
|
||||||
<body className="font-mono bg-zinc-50 text-slate-900 dark:bg-zinc-900 dark:text-slate-100 transition-colors duration-300">
|
<body className="font-mono bg-zinc-50 text-slate-900 dark:bg-zinc-900 dark:text-slate-100 transition-colors duration-300">
|
||||||
<ThemeProvider
|
<ThemeProvider
|
||||||
attribute="class"
|
attribute="class"
|
||||||
@@ -40,22 +47,23 @@ export default function RootLayout({ children }: { children: React.ReactNode })
|
|||||||
storageKey="blog-theme"
|
storageKey="blog-theme"
|
||||||
disableTransitionOnChange={false}
|
disableTransitionOnChange={false}
|
||||||
>
|
>
|
||||||
|
<NextIntlClientProvider messages={messages}>
|
||||||
<div className="flex flex-col min-h-screen">
|
<div className="flex flex-col min-h-screen">
|
||||||
<div className="flex-1">{children}</div>
|
<div className="flex-1">{children}</div>
|
||||||
|
|
||||||
{/* Footer - from worktree-agent-1 */}
|
|
||||||
<footer className="mt-auto border-t-4 border-slate-300 dark:border-slate-800 bg-zinc-100 dark:bg-slate-900 transition-colors duration-300">
|
<footer className="mt-auto border-t-4 border-slate-300 dark:border-slate-800 bg-zinc-100 dark:bg-slate-900 transition-colors duration-300">
|
||||||
<div className="container mx-auto px-4 py-8">
|
<div className="container mx-auto px-4 py-8">
|
||||||
<div className="border-2 border-slate-300 dark:border-slate-800 p-6">
|
<div className="border-2 border-slate-300 dark:border-slate-800 p-6">
|
||||||
<p className="text-center text-slate-500 dark:text-slate-500 font-mono text-xs uppercase tracking-wider">
|
<p className="text-center text-slate-500 dark:text-slate-500 font-mono text-xs uppercase tracking-wider">
|
||||||
© 2025 <span style={{ color: 'var(--neon-cyan)' }}>//</span> BLOG &{' '}
|
© 2025 <span style={{ color: 'var(--neon-cyan)' }}>//</span> BLOG &{' '}
|
||||||
<span style={{ color: 'var(--neon-pink)' }}>PORTOFOLIU</span>{' '}
|
<span style={{ color: 'var(--neon-pink)' }}>RANDOM THOUGHTS</span>{' '}
|
||||||
<span style={{ color: 'var(--neon-cyan)' }}>//</span> ALL RIGHTS RESERVED
|
<span style={{ color: 'var(--neon-cyan)' }}>//</span> ALL RIGHTS RESERVED
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
|
</NextIntlClientProvider>
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
|||||||
const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || 'http://localhost:3030'
|
const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || 'http://localhost:3030'
|
||||||
|
|
||||||
// Get all blog posts
|
// Get all blog posts
|
||||||
const posts = await getAllPosts(false)
|
const posts = await getAllPosts("en", false)
|
||||||
|
|
||||||
// Generate sitemap entries for blog posts
|
// Generate sitemap entries for blog posts
|
||||||
const blogPosts: MetadataRoute.Sitemap = posts.map(post => ({
|
const blogPosts: MetadataRoute.Sitemap = posts.map(post => ({
|
||||||
|
|||||||
@@ -27,16 +27,15 @@ export function OptimizedImage({
|
|||||||
|
|
||||||
if (hasError) {
|
if (hasError) {
|
||||||
return (
|
return (
|
||||||
<div className="my-8 rounded-lg border border-zinc-800 bg-zinc-900/50 p-8 text-center">
|
<span className="block my-8 rounded-lg border border-zinc-800 bg-zinc-900/50 p-8 text-center">
|
||||||
<p className="text-zinc-400">Failed to load image</p>
|
<span className="block text-zinc-400">Failed to load image</span>
|
||||||
{caption && <p className="mt-2 text-sm text-zinc-500">{caption}</p>}
|
{caption && <span className="block mt-2 text-sm text-zinc-500">{caption}</span>}
|
||||||
</div>
|
</span>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
const imageElement = (
|
||||||
<figure className={`my-8 ${className}`}>
|
<span className="block relative overflow-hidden rounded-lg border border-zinc-800 bg-zinc-900/50">
|
||||||
<div className="relative overflow-hidden rounded-lg border border-zinc-800 bg-zinc-900/50">
|
|
||||||
<Image
|
<Image
|
||||||
src={src}
|
src={src}
|
||||||
alt={alt}
|
alt={alt}
|
||||||
@@ -51,14 +50,21 @@ export function OptimizedImage({
|
|||||||
blurDataURL="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='300'%3E%3Crect width='400' height='300' fill='%2318181b'/%3E%3C/svg%3E"
|
blurDataURL="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='300'%3E%3Crect width='400' height='300' fill='%2318181b'/%3E%3C/svg%3E"
|
||||||
/>
|
/>
|
||||||
{isLoading && (
|
{isLoading && (
|
||||||
<div className="absolute inset-0 flex items-center justify-center">
|
<span className="absolute inset-0 flex items-center justify-center">
|
||||||
<div className="h-8 w-8 animate-spin rounded-full border-2 border-emerald-500 border-t-transparent" />
|
<span className="block h-8 w-8 animate-spin rounded-full border-2 border-emerald-500 border-t-transparent" />
|
||||||
</div>
|
</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</span>
|
||||||
|
)
|
||||||
|
|
||||||
|
// Always use <span> to avoid invalid HTML nesting in <p> tags
|
||||||
|
// This prevents hydration mismatches between server and client
|
||||||
|
return (
|
||||||
|
<span className={`block my-8 ${className}`}>
|
||||||
|
{imageElement}
|
||||||
{caption && (
|
{caption && (
|
||||||
<figcaption className="mt-3 text-center text-sm text-zinc-400">{caption}</figcaption>
|
<span className="block mt-3 text-center text-sm text-zinc-400">{caption}</span>
|
||||||
)}
|
)}
|
||||||
</figure>
|
</span>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import Link from 'next/link'
|
import { useTranslations } from 'next-intl'
|
||||||
|
import { Link } from '@/i18n/navigation'
|
||||||
import Image from 'next/image'
|
import Image from 'next/image'
|
||||||
import { Post } from '@/lib/types/frontmatter'
|
import { Post } from '@/lib/types/frontmatter'
|
||||||
import { formatDate } from '@/lib/utils'
|
import { formatDate } from '@/lib/utils'
|
||||||
@@ -9,6 +10,7 @@ interface BlogCardProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function BlogCard({ post, variant }: BlogCardProps) {
|
export function BlogCard({ post, variant }: BlogCardProps) {
|
||||||
|
const t = useTranslations('BlogPost')
|
||||||
const hasImage = !!post.frontmatter.image
|
const hasImage = !!post.frontmatter.image
|
||||||
|
|
||||||
if (!hasImage || variant === 'text-only') {
|
if (!hasImage || variant === 'text-only') {
|
||||||
@@ -38,7 +40,7 @@ export function BlogCard({ post, variant }: BlogCardProps) {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<span className="inline-flex items-center font-mono text-xs uppercase text-cyan-400 hover:text-cyan-300 transition-colors">
|
<span className="inline-flex items-center font-mono text-xs uppercase text-cyan-400 hover:text-cyan-300 transition-colors">
|
||||||
> READ [{post.readingTime}MIN]
|
> {t('readingTime', {minutes: post.readingTime})}
|
||||||
</span>
|
</span>
|
||||||
</article>
|
</article>
|
||||||
</Link>
|
</Link>
|
||||||
@@ -82,7 +84,7 @@ export function BlogCard({ post, variant }: BlogCardProps) {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<span className="inline-flex items-center font-mono text-xs uppercase text-cyan-400 hover:text-cyan-300 transition-colors">
|
<span className="inline-flex items-center font-mono text-xs uppercase text-cyan-400 hover:text-cyan-300 transition-colors">
|
||||||
> READ [{post.readingTime}MIN]
|
> {t('readingTime', {minutes: post.readingTime})}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -127,7 +129,7 @@ export function BlogCard({ post, variant }: BlogCardProps) {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<span className="inline-flex items-center font-mono text-xs uppercase text-cyan-400 hover:text-cyan-300 transition-colors">
|
<span className="inline-flex items-center font-mono text-xs uppercase text-cyan-400 hover:text-cyan-300 transition-colors">
|
||||||
> READ [{post.readingTime}MIN]
|
> {t('readingTime', {minutes: post.readingTime})}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ import rehypeSanitize from 'rehype-sanitize'
|
|||||||
import rehypeRaw from 'rehype-raw'
|
import rehypeRaw from 'rehype-raw'
|
||||||
import { OptimizedImage } from './OptimizedImage'
|
import { OptimizedImage } from './OptimizedImage'
|
||||||
import { CodeBlock } from './code-block'
|
import { CodeBlock } from './code-block'
|
||||||
import Link from 'next/link'
|
import { useLocale } from 'next-intl'
|
||||||
|
import { Link } from '@/i18n/navigation'
|
||||||
|
|
||||||
interface MarkdownRendererProps {
|
interface MarkdownRendererProps {
|
||||||
content: string
|
content: string
|
||||||
@@ -14,21 +15,55 @@ interface MarkdownRendererProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default function MarkdownRenderer({ content, className = '' }: MarkdownRendererProps) {
|
export default function MarkdownRenderer({ content, className = '' }: MarkdownRendererProps) {
|
||||||
|
const locale = useLocale()
|
||||||
return (
|
return (
|
||||||
<div className={`prose prose-invert prose-zinc max-w-none ${className}`}>
|
<div className={`prose prose-invert prose-zinc max-w-none ${className}`}>
|
||||||
<ReactMarkdown
|
<ReactMarkdown
|
||||||
remarkPlugins={[remarkGfm]}
|
remarkPlugins={[remarkGfm]}
|
||||||
rehypePlugins={[rehypeRaw, [rehypeSanitize, {
|
rehypePlugins={[
|
||||||
tagNames: ['p', 'a', 'img', 'code', 'pre', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
|
rehypeRaw,
|
||||||
'ul', 'ol', 'li', 'blockquote', 'table', 'thead', 'tbody', 'tr', 'th', 'td',
|
[
|
||||||
'strong', 'em', 'del', 'br', 'hr', 'div', 'span'],
|
rehypeSanitize,
|
||||||
|
{
|
||||||
|
tagNames: [
|
||||||
|
'p',
|
||||||
|
'a',
|
||||||
|
'img',
|
||||||
|
'code',
|
||||||
|
'pre',
|
||||||
|
'h1',
|
||||||
|
'h2',
|
||||||
|
'h3',
|
||||||
|
'h4',
|
||||||
|
'h5',
|
||||||
|
'h6',
|
||||||
|
'ul',
|
||||||
|
'ol',
|
||||||
|
'li',
|
||||||
|
'blockquote',
|
||||||
|
'table',
|
||||||
|
'thead',
|
||||||
|
'tbody',
|
||||||
|
'tr',
|
||||||
|
'th',
|
||||||
|
'td',
|
||||||
|
'strong',
|
||||||
|
'em',
|
||||||
|
'del',
|
||||||
|
'br',
|
||||||
|
'hr',
|
||||||
|
'div',
|
||||||
|
'span',
|
||||||
|
],
|
||||||
attributes: {
|
attributes: {
|
||||||
a: ['href', 'rel', 'target'],
|
a: ['href', 'rel', 'target'],
|
||||||
img: ['src', 'alt', 'title', 'width', 'height'],
|
img: ['src', 'alt', 'title', 'width', 'height'],
|
||||||
code: ['className'],
|
code: ['className'],
|
||||||
'*': ['className', 'id']
|
'*': ['className', 'id'],
|
||||||
}
|
},
|
||||||
}]]}
|
},
|
||||||
|
],
|
||||||
|
]}
|
||||||
components={{
|
components={{
|
||||||
img: ({ node, src, alt, title, ...props }) => {
|
img: ({ node, src, alt, title, ...props }) => {
|
||||||
if (!src || typeof src !== 'string') return null
|
if (!src || typeof src !== 'string') return null
|
||||||
@@ -55,19 +90,19 @@ export default function MarkdownRenderer({ content, className = '' }: MarkdownRe
|
|||||||
: [alt, undefined]
|
: [alt, undefined]
|
||||||
|
|
||||||
const url = new URL(absoluteSrc, 'http://localhost')
|
const url = new URL(absoluteSrc, 'http://localhost')
|
||||||
const width = url.searchParams.get('w') ? parseInt(url.searchParams.get('w')!) : 800
|
const width = url.searchParams.get('w') ? parseInt(url.searchParams.get('w')!) : null
|
||||||
const height = url.searchParams.get('h') ? parseInt(url.searchParams.get('h')!) : 600
|
const height = url.searchParams.get('h') ? parseInt(url.searchParams.get('h')!) : null
|
||||||
const cleanSrc = absoluteSrc.split('?')[0]
|
const cleanSrc = absoluteSrc.split('?')[0]
|
||||||
|
|
||||||
return (
|
const imageProps = {
|
||||||
<OptimizedImage
|
src: cleanSrc,
|
||||||
src={cleanSrc}
|
alt: altText || alt || '',
|
||||||
alt={altText || alt || ''}
|
caption: caption,
|
||||||
caption={caption}
|
...(width && { width }),
|
||||||
width={width}
|
...(height && { height }),
|
||||||
height={height}
|
}
|
||||||
/>
|
|
||||||
)
|
return <OptimizedImage {...imageProps} />
|
||||||
},
|
},
|
||||||
code: ({ node, className, children, ...props }) => {
|
code: ({ node, className, children, ...props }) => {
|
||||||
const inline = !className && typeof children === 'string' && !children.includes('\n')
|
const inline = !className && typeof children === 'string' && !children.includes('\n')
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import Link from 'next/link'
|
import { useTranslations } from 'next-intl'
|
||||||
|
import { Link } from '@/i18n/navigation'
|
||||||
import { ThemeToggle } from '@/components/theme-toggle'
|
import { ThemeToggle } from '@/components/theme-toggle'
|
||||||
|
import LanguageSwitcher from '@/components/layout/LanguageSwitcher'
|
||||||
|
|
||||||
export function Navbar() {
|
export function Navbar() {
|
||||||
|
const t = useTranslations('Navigation')
|
||||||
const [isVisible, setIsVisible] = useState(true)
|
const [isVisible, setIsVisible] = useState(true)
|
||||||
const [lastScrollY, setLastScrollY] = useState(0)
|
const [lastScrollY, setLastScrollY] = useState(0)
|
||||||
|
|
||||||
@@ -39,10 +42,10 @@ export function Navbar() {
|
|||||||
className="font-mono text-sm uppercase tracking-wider transition-colors cursor-pointer"
|
className="font-mono text-sm uppercase tracking-wider transition-colors cursor-pointer"
|
||||||
style={{ color: 'var(--neon-cyan)' }}
|
style={{ color: 'var(--neon-cyan)' }}
|
||||||
>
|
>
|
||||||
< HOME
|
< {t('home')}
|
||||||
</Link>
|
</Link>
|
||||||
<span className="font-mono text-sm text-zinc-100 dark:text-zinc-300 uppercase tracking-wider">
|
<span className="font-mono text-sm text-zinc-100 dark:text-zinc-300 uppercase tracking-wider">
|
||||||
// <span style={{ color: 'var(--neon-pink)' }}>BLOG</span> ARCHIVE
|
// <span style={{ color: 'var(--neon-pink)' }}>{t('blog')}</span> ARCHIVE
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center gap-6">
|
<div className="flex items-center gap-6">
|
||||||
@@ -50,9 +53,16 @@ export function Navbar() {
|
|||||||
href="/about"
|
href="/about"
|
||||||
className="font-mono text-sm text-zinc-400 dark:text-zinc-500 uppercase tracking-wider hover:text-cyan-400 dark:hover:text-cyan-300 transition-colors cursor-pointer"
|
className="font-mono text-sm text-zinc-400 dark:text-zinc-500 uppercase tracking-wider hover:text-cyan-400 dark:hover:text-cyan-300 transition-colors cursor-pointer"
|
||||||
>
|
>
|
||||||
[ABOUT]
|
[{t('about')}]
|
||||||
|
</Link>
|
||||||
|
<Link
|
||||||
|
href="/blog"
|
||||||
|
className="font-mono text-sm text-zinc-400 dark:text-zinc-500 uppercase tracking-wider hover:text-cyan-400 dark:hover:text-cyan-300 transition-colors cursor-pointer"
|
||||||
|
>
|
||||||
|
[{t('blog')}]
|
||||||
</Link>
|
</Link>
|
||||||
<ThemeToggle />
|
<ThemeToggle />
|
||||||
|
<LanguageSwitcher />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { getPopularTags } from '@/lib/tags'
|
|||||||
import { TagBadge } from './tag-badge'
|
import { TagBadge } from './tag-badge'
|
||||||
|
|
||||||
export async function PopularTags({ limit = 5 }: { limit?: number }) {
|
export async function PopularTags({ limit = 5 }: { limit?: number }) {
|
||||||
const tags = await getPopularTags(limit)
|
const tags = await getPopularTags("en", limit)
|
||||||
|
|
||||||
if (tags.length === 0) return null
|
if (tags.length === 0) return null
|
||||||
|
|
||||||
|
|||||||
@@ -30,9 +30,9 @@ export function ReadingProgress() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="fixed top-4 right-4 z-50 px-3 py-1.5 bg-[rgb(var(--bg-primary))] border-2 border-[var(--neon-cyan)] text-xs font-mono font-bold text-[var(--neon-cyan)] relative">
|
{/* <div className="fixed left-13 z-50 m-3 px-3 py-1.5 bg-[rgb(var(--bg-primary))] border-2 border-[var(--neon-cyan)] text-xs font-mono font-bold text-[var(--neon-cyan)]">
|
||||||
<span className="relative z-10">[{Math.round(progress)}%]</span>
|
<span className="left-4 z-10">[{Math.round(progress)}%]</span>
|
||||||
</div>
|
</div> */}
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,17 +43,12 @@ export function StickyFooter({ url, title }: StickyFooterProps) {
|
|||||||
className={`
|
className={`
|
||||||
fixed bottom-0 left-0 right-0 z-40
|
fixed bottom-0 left-0 right-0 z-40
|
||||||
bg-black/98 backdrop-blur-sm
|
bg-black/98 backdrop-blur-sm
|
||||||
border-t-4 border-[var(--neon-magenta)]
|
border-t-1 border-[var(--neon-magenta)]
|
||||||
transition-transform duration-200 ease-in-out
|
transition-transform duration-200 ease-in-out
|
||||||
${isVisible ? 'translate-y-0' : 'translate-y-full'}
|
${isVisible ? 'translate-y-0' : 'translate-y-full'}
|
||||||
`}
|
`}
|
||||||
style={{
|
|
||||||
boxShadow: isVisible
|
|
||||||
? '0 -8px 30px rgba(155,90,142,0.5), inset 0 4px 20px rgba(155,90,142,0.1)'
|
|
||||||
: 'none',
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<div className="absolute top-0 left-0 w-full h-1 bg-gradient-to-r from-transparent via-[var(--neon-magenta)] to-transparent opacity-70" />
|
<div className="absolute top-0 left-0 w-full h-1 bg-gradient-to-r from-transparent to-transparent opacity-70" />
|
||||||
|
|
||||||
<div className="max-w-7xl mx-auto px-6 py-4 relative">
|
<div className="max-w-7xl mx-auto px-6 py-4 relative">
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import Link from 'next/link'
|
import { useTranslations } from 'next-intl'
|
||||||
|
import { Link } from '@/i18n/navigation'
|
||||||
import { TagInfo } from '@/lib/tags'
|
import { TagInfo } from '@/lib/tags'
|
||||||
|
|
||||||
interface TagCloudProps {
|
interface TagCloudProps {
|
||||||
@@ -6,6 +7,7 @@ interface TagCloudProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function TagCloud({ tags }: TagCloudProps) {
|
export function TagCloud({ tags }: TagCloudProps) {
|
||||||
|
const t = useTranslations('Tags')
|
||||||
const sizeClasses = {
|
const sizeClasses = {
|
||||||
sm: 'text-xs opacity-70',
|
sm: 'text-xs opacity-70',
|
||||||
md: 'text-sm',
|
md: 'text-sm',
|
||||||
@@ -26,7 +28,7 @@ export function TagCloud({ tags }: TagCloudProps) {
|
|||||||
hover:text-cyan-400
|
hover:text-cyan-400
|
||||||
transition-colors
|
transition-colors
|
||||||
`}
|
`}
|
||||||
title={`${tag.count} ${tag.count === 1 ? 'articol' : 'articole'}`}
|
title={t('postsWithTag', {count: tag.count, tag: tag.name})}
|
||||||
>
|
>
|
||||||
#{tag.name}
|
#{tag.name}
|
||||||
</Link>
|
</Link>
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import Link from 'next/link'
|
import {Link} from '@/i18n/navigation'
|
||||||
import { usePathname } from 'next/navigation'
|
import { usePathname } from 'next/navigation'
|
||||||
|
import { useLocale, useTranslations } from 'next-intl'
|
||||||
import { Fragment } from 'react'
|
import { Fragment } from 'react'
|
||||||
import { BreadcrumbsSchema } from './breadcrumbs-schema'
|
import { BreadcrumbsSchema } from './breadcrumbs-schema'
|
||||||
|
|
||||||
@@ -38,11 +39,22 @@ function ChevronIcon({ className }: { className?: string }) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatSegmentLabel(segment: string): string {
|
export function Breadcrumbs({ items }: { items?: BreadcrumbItem[] }) {
|
||||||
|
const pathname = usePathname()
|
||||||
|
const locale = useLocale()
|
||||||
|
const t = useTranslations('Breadcrumbs')
|
||||||
|
|
||||||
|
// Hide breadcrumbs on main page
|
||||||
|
const isMainPage = pathname === `/${locale}` || pathname === '/'
|
||||||
|
if (isMainPage) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
const formatSegmentLabel = (segment: string): string => {
|
||||||
const specialCases: { [key: string]: string } = {
|
const specialCases: { [key: string]: string } = {
|
||||||
blog: 'Blog',
|
blog: t('blog'),
|
||||||
tags: 'Tag-uri',
|
tags: t('tags'),
|
||||||
about: 'Despre',
|
about: t('about'),
|
||||||
}
|
}
|
||||||
|
|
||||||
if (specialCases[segment]) {
|
if (specialCases[segment]) {
|
||||||
@@ -55,9 +67,6 @@ function formatSegmentLabel(segment: string): string {
|
|||||||
.join(' ')
|
.join(' ')
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Breadcrumbs({ items }: { items?: BreadcrumbItem[] }) {
|
|
||||||
const pathname = usePathname()
|
|
||||||
|
|
||||||
let breadcrumbs: BreadcrumbItem[] = items || []
|
let breadcrumbs: BreadcrumbItem[] = items || []
|
||||||
|
|
||||||
if (!items) {
|
if (!items) {
|
||||||
@@ -71,12 +80,8 @@ export function Breadcrumbs({ items }: { items?: BreadcrumbItem[] }) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pathname === '/') {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
const schemaItems = [
|
const schemaItems = [
|
||||||
{ position: 1, name: 'Acasă', item: '/' },
|
{ position: 1, name: t('home'), item: '/' },
|
||||||
...breadcrumbs.map((item, index) => ({
|
...breadcrumbs.map((item, index) => ({
|
||||||
position: index + 2,
|
position: index + 2,
|
||||||
name: item.label,
|
name: item.label,
|
||||||
@@ -96,7 +101,7 @@ export function Breadcrumbs({ items }: { items?: BreadcrumbItem[] }) {
|
|||||||
<Link
|
<Link
|
||||||
href="/"
|
href="/"
|
||||||
className="flex items-center text-gray-500 hover:text-primary-600 transition"
|
className="flex items-center text-gray-500 hover:text-primary-600 transition"
|
||||||
aria-label="Acasă"
|
aria-label={t('home')}
|
||||||
>
|
>
|
||||||
<HomeIcon className="w-4 h-4" />
|
<HomeIcon className="w-4 h-4" />
|
||||||
</Link>
|
</Link>
|
||||||
|
|||||||
59
components/layout/LanguageSwitcher.tsx
Normal file
59
components/layout/LanguageSwitcher.tsx
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import {useLocale} from 'next-intl';
|
||||||
|
import {useRouter, usePathname} from '@/i18n/navigation';
|
||||||
|
import {routing} from '@/i18n/routing';
|
||||||
|
import {useState} from 'react';
|
||||||
|
|
||||||
|
export default function LanguageSwitcher() {
|
||||||
|
const locale = useLocale();
|
||||||
|
const router = useRouter();
|
||||||
|
const pathname = usePathname();
|
||||||
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
|
|
||||||
|
const handleLocaleChange = (newLocale: string) => {
|
||||||
|
router.replace(pathname, {locale: newLocale});
|
||||||
|
router.refresh();
|
||||||
|
setIsOpen(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="relative z-[100]">
|
||||||
|
<button
|
||||||
|
onClick={() => setIsOpen(!isOpen)}
|
||||||
|
className="px-3 py-1 border-2 border-slate-700 font-mono uppercase text-xs hover:border-cyan-500 transition-colors"
|
||||||
|
aria-label="Switch language"
|
||||||
|
>
|
||||||
|
{locale}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
{isOpen && (
|
||||||
|
<div className="absolute right-0 top-full mt-2 bg-slate-900 border-2 border-slate-700 min-w-[120px] z-[100]">
|
||||||
|
{routing.locales.map((loc: string) => (
|
||||||
|
<button
|
||||||
|
key={loc}
|
||||||
|
onClick={() => handleLocaleChange(loc)}
|
||||||
|
className={`
|
||||||
|
w-full text-left px-4 py-2 font-mono uppercase text-xs
|
||||||
|
border-b border-slate-700 last:border-b-0
|
||||||
|
${locale === loc
|
||||||
|
? 'bg-cyan-900 text-cyan-300'
|
||||||
|
: 'text-slate-400 hover:bg-slate-800'
|
||||||
|
}
|
||||||
|
`}
|
||||||
|
>
|
||||||
|
{loc === 'en' ? 'English' : 'Română'}
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{isOpen && (
|
||||||
|
<div
|
||||||
|
className="fixed inset-0 z-40"
|
||||||
|
onClick={() => setIsOpen(false)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
41
content/blog/en/why-this-page.md
Normal file
41
content/blog/en/why-this-page.md
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
---
|
||||||
|
title: 'Why I created this page'
|
||||||
|
description: 'First post'
|
||||||
|
date: '2025-12-02'
|
||||||
|
author: 'Rares'
|
||||||
|
category: 'Opinion'
|
||||||
|
tags: ['opinion']
|
||||||
|
image: ''
|
||||||
|
draft: false
|
||||||
|
---
|
||||||
|
|
||||||
|
# Why I Created This Blog & Why It's Not Just About Tech
|
||||||
|
|
||||||
|
Hi there! Welcome to my blog. If you're wondering why I created this space, it's because I wanted to share more than just technical tutorials or how-to guides – though you'll find those here too. This blog is a reflection of me and my journey through the world of technology, self-hosting, and beyond.
|
||||||
|
|
||||||
|
## Why a blog?
|
||||||
|
|
||||||
|
You might be thinking, "Why create another tech blog? There are plenty out there."
|
||||||
|
Well, yes, there are. But I believe that sharing some of my opinions and experiences will eventually act out as a journal:
|
||||||
|
|
||||||
|
1. **Personal touch**: Even though i've been working corporate all my career, this webpage won't contain that sugar coated language 😅. It's a place where you'll get to know me – my thoughts, my mistakes, and my victories. I believe that this personal touch makes the content more engaging and relatable.
|
||||||
|
2. **Beyond tech**: While I'll be writing about technology, I also want to explore other topics that interest me, such as mental health, productivity and so on.... I think a well-rounded approach can help create a more engaging and informative space.
|
||||||
|
3. **Self-hosting adventure**: As you might have guessed from the title, this blog is self-hosted. This was an exciting journey for me, and I'll be sharing my experiences, challenges, and learnings along the way. If you're interested in self-hosting or just want to understand what it's all about, you might find what worked for me or didn't.
|
||||||
|
|
||||||
|
## Why self-host?
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Now, let's talk about why I chose to self-host this blog. In a nutshell, self-hosting gave me:
|
||||||
|
|
||||||
|
- **Full control**: By hosting my own website, I have complete control over my content and how it's displayed. No more compromises or limitations imposed by third-party platforms.
|
||||||
|
- **Owning my data**: It's just, that I can have control over my data without others snooping around.
|
||||||
|
- **It's fun**: Started looking into sysadmin/devops for a long time, after a burnout I stepped into selfhosting more convincingly.
|
||||||
|
|
||||||
|
## What to expect
|
||||||
|
|
||||||
|
As I mentioned earlier, this blog will be a mix of tech tutorials, personal thoughts, and everything in between. Here's what you can look forward to:
|
||||||
|
|
||||||
|
- **Tech how-tos**: Step-by-step guides on various topics, from setting up your own development environment to configuring your server.
|
||||||
|
- **Self-hosting adventures**: My experiences, learnings, and tips on self-hosting, including challenges faced and solutions implemented.
|
||||||
|
- **Random musings**: Thoughts on productivity, mental health, and other interests of mine that might not be directly related to tech.
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
---
|
|
||||||
title: 'Getting Started with Next.js 15'
|
|
||||||
description: 'Learn how to build modern web applications with Next.js 15 and TypeScript.'
|
|
||||||
date: '2025-01-07'
|
|
||||||
author: 'John Doe'
|
|
||||||
category: 'Tutorial'
|
|
||||||
tags: ['nextjs', 'typescript', 'tutorial']
|
|
||||||
---
|
|
||||||
|
|
||||||
# Getting Started with Next.js 15
|
|
||||||
|
|
||||||
Welcome to this example blog post! This post demonstrates how markdown content is rendered.
|
|
||||||
|
|
||||||
## Features
|
|
||||||
|
|
||||||
- Server Components by default
|
|
||||||
- Improved performance
|
|
||||||
- Better TypeScript support
|
|
||||||
|
|
||||||
## Code Example
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
export default function Page() {
|
|
||||||
return <h1>Hello, Next.js 15!</h1>
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Check out this article:
|
|
||||||
|
|
||||||
[Check this out](tech/articol-tehnic.md)
|
|
||||||
|
|
||||||
## Conclusion
|
|
||||||
|
|
||||||
Next.js 15 brings many improvements for building modern web applications.
|
|
||||||
41
content/blog/ro/why-this-page.md
Normal file
41
content/blog/ro/why-this-page.md
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
---
|
||||||
|
title: 'Why I created this page'
|
||||||
|
description: 'First post'
|
||||||
|
date: '2025-12-02'
|
||||||
|
author: 'Rares'
|
||||||
|
category: 'Opinion'
|
||||||
|
tags: ['opinion']
|
||||||
|
image: ''
|
||||||
|
draft: false
|
||||||
|
---
|
||||||
|
|
||||||
|
# De ce aceasta pagina?
|
||||||
|
|
||||||
|
Daca te intrebi de ce aceata pagina? Pentru ca vreau sa jurnalizez lucrurile la care lucrez, sau gandurile pe care vreua sa le impartesesc.
|
||||||
|
|
||||||
|
## Why a blog?
|
||||||
|
|
||||||
|
You might be thinking, "Why create another tech blog? There are plenty out there."
|
||||||
|
Well, yes, there are. But I believe that sharing some of my opinions and experiences will eventually act out as a journal:
|
||||||
|
|
||||||
|
1. **Personal touch**: Even though i've been working corporate all my career, this webpage won't contain that sugar coated language 😅. It's a place where you'll get to know me – my thoughts, my mistakes, and my victories. I believe that this personal touch makes the content more engaging and relatable.
|
||||||
|
2. **Beyond tech**: While I'll be writing about technology, I also want to explore other topics that interest me, such as mental health, productivity and so on.... I think a well-rounded approach can help create a more engaging and informative space.
|
||||||
|
3. **Self-hosting adventure**: As you might have guessed from the title, this blog is self-hosted. This was an exciting journey for me, and I'll be sharing my experiences, challenges, and learnings along the way. If you're interested in self-hosting or just want to understand what it's all about, you might find what worked for me or didn't.
|
||||||
|
|
||||||
|
## Why self-host?
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Now, let's talk about why I chose to self-host this blog. In a nutshell, self-hosting gave me:
|
||||||
|
|
||||||
|
- **Full control**: By hosting my own website, I have complete control over my content and how it's displayed. No more compromises or limitations imposed by third-party platforms.
|
||||||
|
- **Owning my data**: It's just, that I can have control over my data without others snooping around.
|
||||||
|
- **It's fun**: Started looking into sysadmin/devops for a long time, after a burnout I stepped into selfhosting more convincingly.
|
||||||
|
|
||||||
|
## What to expect
|
||||||
|
|
||||||
|
As I mentioned earlier, this blog will be a mix of tech tutorials, personal thoughts, and everything in between. Here's what you can look forward to:
|
||||||
|
|
||||||
|
- **Tech how-tos**: Step-by-step guides on various topics, from setting up your own development environment to configuring your server.
|
||||||
|
- **Self-hosting adventures**: My experiences, learnings, and tips on self-hosting, including challenges faced and solutions implemented.
|
||||||
|
- **Random musings**: Thoughts on productivity, mental health, and other interests of mine that might not be directly related to tech.
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
---
|
|
||||||
title: 'Technical Article'
|
|
||||||
description: 'A technical article to test internal links'
|
|
||||||
date: '2025-01-10'
|
|
||||||
author: 'John Doe'
|
|
||||||
category: 'Tech'
|
|
||||||
tags: ['tech', 'test']
|
|
||||||
---
|
|
||||||
|
|
||||||
# Technical Article
|
|
||||||
|
|
||||||
This is a test article for internal blog post linking.
|
|
||||||
|
|
||||||
Imagine cooler:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## Content
|
|
||||||
|
|
||||||
You are reading the technical article that was linked from the example post.
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 171 KiB |
@@ -1,109 +0,0 @@
|
|||||||
---
|
|
||||||
title: 'Test Complet Markdown'
|
|
||||||
description: 'Un articol de test care demonstrează toate elementele markdown suportate'
|
|
||||||
date: '2025-01-15'
|
|
||||||
author: 'Test Author'
|
|
||||||
category: 'Tutorial'
|
|
||||||
tags: ['markdown', 'test', 'demo']
|
|
||||||
image: '/38636.jpg'
|
|
||||||
draft: false
|
|
||||||
---
|
|
||||||
|
|
||||||
# Heading 1
|
|
||||||
|
|
||||||
Acesta este un paragraf normal cu **text bold** și _text italic_. Putem combina **_bold și italic_**.
|
|
||||||
|
|
||||||
## Heading 2
|
|
||||||
|
|
||||||
### Heading 3
|
|
||||||
|
|
||||||
#### Heading 4
|
|
||||||
|
|
||||||
##### Heading 5
|
|
||||||
|
|
||||||
###### Heading 6
|
|
||||||
|
|
||||||
## Liste
|
|
||||||
|
|
||||||
### Listă neordonată
|
|
||||||
|
|
||||||
- Item 1
|
|
||||||
- Item 2
|
|
||||||
- Subitem 2.1
|
|
||||||
- Subitem 2.2
|
|
||||||
- Item 3
|
|
||||||
|
|
||||||
### Listă ordonată
|
|
||||||
|
|
||||||
1. Primul item
|
|
||||||
2. Al doilea item
|
|
||||||
3. Al treilea item
|
|
||||||
|
|
||||||
## Cod
|
|
||||||
|
|
||||||
Cod inline: `const x = 42;`
|
|
||||||
|
|
||||||
Bloc de cod JavaScript:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
function greet(name) {
|
|
||||||
console.log(`Hello, ${name}!`)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
greet('World')
|
|
||||||
```
|
|
||||||
|
|
||||||
Bloc de cod Python:
|
|
||||||
|
|
||||||
```python
|
|
||||||
def calculate_sum(a, b):
|
|
||||||
"""Calculate sum of two numbers"""
|
|
||||||
return a + b
|
|
||||||
|
|
||||||
result = calculate_sum(5, 10)
|
|
||||||
print(f"Result: {result}")
|
|
||||||
```
|
|
||||||
|
|
||||||
## Blockquote
|
|
||||||
|
|
||||||
> Acesta este un blockquote.
|
|
||||||
> Poate avea multiple linii.
|
|
||||||
>
|
|
||||||
> Și paragrafe separate.
|
|
||||||
|
|
||||||
## Link-uri
|
|
||||||
|
|
||||||
[Link intern](/blog/alt-articol)
|
|
||||||
|
|
||||||
[Link extern](https://example.com)
|
|
||||||
|
|
||||||
## Imagini
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## Tabele
|
|
||||||
|
|
||||||
| Coloana 1 | Coloana 2 | Coloana 3 |
|
|
||||||
| --------- | --------- | --------- |
|
|
||||||
| Celula 1 | Celula 2 | Celula 3 |
|
|
||||||
| Date 1 | Date 2 | Date 3 |
|
|
||||||
| Info 1 | Info 2 | Info 3 |
|
|
||||||
|
|
||||||
## Linie orizontală
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Task List (GFM)
|
|
||||||
|
|
||||||
- [x] Task completat
|
|
||||||
- [ ] Task incomplet
|
|
||||||
- [ ] Alt task
|
|
||||||
|
|
||||||
## Strikethrough
|
|
||||||
|
|
||||||
~~Text șters~~
|
|
||||||
|
|
||||||
## Concluzie
|
|
||||||
|
|
||||||
Acesta este sfârșitul articolului de test.
|
|
||||||
BIN
content/blog/whythispage/selfhostedrig.gif
Normal file
BIN
content/blog/whythispage/selfhostedrig.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 MiB |
@@ -33,7 +33,7 @@ export function calculateReadingTime(content: string): number {
|
|||||||
return Math.ceil(words / wordsPerMinute)
|
return Math.ceil(words / wordsPerMinute)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function validateFrontmatter(data: any): FrontMatter {
|
export function validateFrontmatter(data: any, locale?: string): FrontMatter {
|
||||||
if (!data.title || typeof data.title !== 'string') {
|
if (!data.title || typeof data.title !== 'string') {
|
||||||
throw new Error('Invalid title')
|
throw new Error('Invalid title')
|
||||||
}
|
}
|
||||||
@@ -60,15 +60,19 @@ export function validateFrontmatter(data: any): FrontMatter {
|
|||||||
author: data.author,
|
author: data.author,
|
||||||
category: data.category,
|
category: data.category,
|
||||||
tags: data.tags,
|
tags: data.tags,
|
||||||
|
locale: data.locale || locale || 'en',
|
||||||
image: data.image,
|
image: data.image,
|
||||||
draft: data.draft || false,
|
draft: data.draft || false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getPostBySlug(slug: string | string[]): Promise<Post | null> {
|
export async function getPostBySlug(
|
||||||
|
slug: string | string[],
|
||||||
|
locale: string = 'en'
|
||||||
|
): Promise<Post | null> {
|
||||||
const slugArray = Array.isArray(slug) ? slug : slug.split('/')
|
const slugArray = Array.isArray(slug) ? slug : slug.split('/')
|
||||||
const sanitized = slugArray.map(s => sanitizePath(s))
|
const sanitized = slugArray.map(s => sanitizePath(s))
|
||||||
const fullPath = path.join(POSTS_PATH, ...sanitized) + '.md'
|
const fullPath = path.join(POSTS_PATH, locale, ...sanitized) + '.md'
|
||||||
|
|
||||||
if (!fs.existsSync(fullPath)) {
|
if (!fs.existsSync(fullPath)) {
|
||||||
return null
|
return null
|
||||||
@@ -76,7 +80,7 @@ export async function getPostBySlug(slug: string | string[]): Promise<Post | nul
|
|||||||
|
|
||||||
const fileContents = fs.readFileSync(fullPath, 'utf8')
|
const fileContents = fs.readFileSync(fullPath, 'utf8')
|
||||||
const { data, content } = matter(fileContents)
|
const { data, content } = matter(fileContents)
|
||||||
const frontmatter = validateFrontmatter(data)
|
const frontmatter = validateFrontmatter(data, locale)
|
||||||
|
|
||||||
const processed = await remark()
|
const processed = await remark()
|
||||||
.use(remarkGfm)
|
.use(remarkGfm)
|
||||||
@@ -85,13 +89,14 @@ export async function getPostBySlug(slug: string | string[]): Promise<Post | nul
|
|||||||
publicDir: 'public/blog',
|
publicDir: 'public/blog',
|
||||||
currentSlug: sanitized.join('/'),
|
currentSlug: sanitized.join('/'),
|
||||||
})
|
})
|
||||||
.use(remarkInternalLinks)
|
.use(remarkInternalLinks, { locale })
|
||||||
.process(content)
|
.process(content)
|
||||||
|
|
||||||
const processedContent = processed.toString()
|
const processedContent = processed.toString()
|
||||||
|
|
||||||
return {
|
return {
|
||||||
slug: sanitized.join('/'),
|
slug: sanitized.join('/'),
|
||||||
|
locale,
|
||||||
frontmatter,
|
frontmatter,
|
||||||
content: processedContent,
|
content: processedContent,
|
||||||
readingTime: calculateReadingTime(processedContent),
|
readingTime: calculateReadingTime(processedContent),
|
||||||
@@ -99,8 +104,14 @@ export async function getPostBySlug(slug: string | string[]): Promise<Post | nul
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getAllPosts(includeContent = false): Promise<Post[]> {
|
export async function getAllPosts(locale: string = 'en', includeContent = false): Promise<Post[]> {
|
||||||
const posts: Post[] = []
|
const posts: Post[] = []
|
||||||
|
const localeDir = path.join(POSTS_PATH, locale)
|
||||||
|
|
||||||
|
if (!fs.existsSync(localeDir)) {
|
||||||
|
console.warn(`Locale directory not found: ${localeDir}`)
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
|
||||||
async function walkDir(dir: string, prefix = ''): Promise<void> {
|
async function walkDir(dir: string, prefix = ''): Promise<void> {
|
||||||
const files = fs.readdirSync(dir)
|
const files = fs.readdirSync(dir)
|
||||||
@@ -114,7 +125,7 @@ export async function getAllPosts(includeContent = false): Promise<Post[]> {
|
|||||||
} else if (file.endsWith('.md')) {
|
} else if (file.endsWith('.md')) {
|
||||||
const slug = prefix ? `${prefix}/${file.replace(/\.md$/, '')}` : file.replace(/\.md$/, '')
|
const slug = prefix ? `${prefix}/${file.replace(/\.md$/, '')}` : file.replace(/\.md$/, '')
|
||||||
try {
|
try {
|
||||||
const post = await getPostBySlug(slug.split('/'))
|
const post = await getPostBySlug(slug.split('/'), locale)
|
||||||
if (post && !post.frontmatter.draft) {
|
if (post && !post.frontmatter.draft) {
|
||||||
posts.push(includeContent ? post : { ...post, content: '' })
|
posts.push(includeContent ? post : { ...post, content: '' })
|
||||||
}
|
}
|
||||||
@@ -125,20 +136,22 @@ export async function getAllPosts(includeContent = false): Promise<Post[]> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fs.existsSync(POSTS_PATH)) {
|
await walkDir(localeDir)
|
||||||
await walkDir(POSTS_PATH)
|
|
||||||
}
|
|
||||||
|
|
||||||
return posts.sort(
|
return posts.sort(
|
||||||
(a, b) => new Date(b.frontmatter.date).getTime() - new Date(a.frontmatter.date).getTime()
|
(a, b) => new Date(b.frontmatter.date).getTime() - new Date(a.frontmatter.date).getTime()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getRelatedPosts(currentSlug: string, limit = 3): Promise<Post[]> {
|
export async function getRelatedPosts(
|
||||||
const currentPost = await getPostBySlug(currentSlug)
|
currentSlug: string,
|
||||||
|
locale: string = 'en',
|
||||||
|
limit = 3
|
||||||
|
): Promise<Post[]> {
|
||||||
|
const currentPost = await getPostBySlug(currentSlug, locale)
|
||||||
if (!currentPost) return []
|
if (!currentPost) return []
|
||||||
|
|
||||||
const allPosts = await getAllPosts(false)
|
const allPosts = await getAllPosts(locale, false)
|
||||||
const { category, tags } = currentPost.frontmatter
|
const { category, tags } = currentPost.frontmatter
|
||||||
|
|
||||||
const scored = allPosts
|
const scored = allPosts
|
||||||
@@ -155,8 +168,13 @@ export async function getRelatedPosts(currentSlug: string, limit = 3): Promise<P
|
|||||||
return scored.slice(0, limit).map(({ post }) => post)
|
return scored.slice(0, limit).map(({ post }) => post)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getAllPostSlugs(): string[][] {
|
export function getAllPostSlugs(locale: string = 'en'): string[][] {
|
||||||
const slugs: string[][] = []
|
const slugs: string[][] = []
|
||||||
|
const localeDir = path.join(POSTS_PATH, locale)
|
||||||
|
|
||||||
|
if (!fs.existsSync(localeDir)) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
|
||||||
function walkDir(dir: string, prefix: string[] = []): void {
|
function walkDir(dir: string, prefix: string[] = []): void {
|
||||||
const files = fs.readdirSync(dir)
|
const files = fs.readdirSync(dir)
|
||||||
@@ -173,9 +191,26 @@ export function getAllPostSlugs(): string[][] {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fs.existsSync(POSTS_PATH)) {
|
walkDir(localeDir)
|
||||||
walkDir(POSTS_PATH)
|
|
||||||
}
|
|
||||||
|
|
||||||
return slugs
|
return slugs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function getAvailableLocales(slug: string): Promise<string[]> {
|
||||||
|
const locales = ['en', 'ro']
|
||||||
|
const available: string[] = []
|
||||||
|
|
||||||
|
for (const locale of locales) {
|
||||||
|
const post = await getPostBySlug(slug, locale)
|
||||||
|
if (post) {
|
||||||
|
available.push(locale)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return available
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function getPostCount(locale: string): Promise<number> {
|
||||||
|
const posts = await getAllPosts(locale, false)
|
||||||
|
return posts.length
|
||||||
|
}
|
||||||
|
|||||||
@@ -7,6 +7,10 @@ interface LinkNode extends Node {
|
|||||||
children: Node[]
|
children: Node[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface Options {
|
||||||
|
locale?: string
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Detects internal blog post links:
|
* Detects internal blog post links:
|
||||||
* - Relative paths (no http/https)
|
* - Relative paths (no http/https)
|
||||||
@@ -24,11 +28,11 @@ function isInternalBlogLink(url: string): boolean {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Transforms internal .md links to blog routes:
|
* Transforms internal .md links to blog routes:
|
||||||
* - tech/article.md → /blog/tech/article
|
* - tech/article.md → /[locale]/blog/tech/article
|
||||||
* - article.md#section → /blog/article#section
|
* - article.md#section → /[locale]/blog/article#section
|
||||||
* - nested/path/post.md?ref=foo → /blog/nested/path/post?ref=foo
|
* - nested/path/post.md?ref=foo → /[locale]/blog/nested/path/post?ref=foo
|
||||||
*/
|
*/
|
||||||
function transformToBlogPath(url: string): string {
|
function transformToBlogPath(url: string, locale: string = 'en'): string {
|
||||||
// Split into path, hash, and query
|
// Split into path, hash, and query
|
||||||
const hashIndex = url.indexOf('#')
|
const hashIndex = url.indexOf('#')
|
||||||
const queryIndex = url.indexOf('?')
|
const queryIndex = url.indexOf('?')
|
||||||
@@ -50,17 +54,19 @@ function transformToBlogPath(url: string): string {
|
|||||||
// Remove .md extension
|
// Remove .md extension
|
||||||
const cleanPath = path.replace(/\.md$/, '')
|
const cleanPath = path.replace(/\.md$/, '')
|
||||||
|
|
||||||
// Build final URL
|
// Build final URL with locale prefix
|
||||||
return `/blog/${cleanPath}${query}${hash}`
|
return `/${locale}/blog/${cleanPath}${query}${hash}`
|
||||||
}
|
}
|
||||||
|
|
||||||
export function remarkInternalLinks() {
|
export function remarkInternalLinks(options: Options = {}) {
|
||||||
|
const locale = options.locale || 'en'
|
||||||
|
|
||||||
return (tree: Node) => {
|
return (tree: Node) => {
|
||||||
visit(tree, 'link', (node: Node) => {
|
visit(tree, 'link', (node: Node) => {
|
||||||
const linkNode = node as LinkNode
|
const linkNode = node as LinkNode
|
||||||
|
|
||||||
if (isInternalBlogLink(linkNode.url)) {
|
if (isInternalBlogLink(linkNode.url)) {
|
||||||
linkNode.url = transformToBlogPath(linkNode.url)
|
linkNode.url = transformToBlogPath(linkNode.url, locale)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
24
lib/tags.ts
24
lib/tags.ts
@@ -25,8 +25,8 @@ export function slugifyTag(tag: string): string {
|
|||||||
.replace(/^-|-$/g, '')
|
.replace(/^-|-$/g, '')
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getAllTags(): Promise<TagInfo[]> {
|
export async function getAllTags(locale: string = 'en'): Promise<TagInfo[]> {
|
||||||
const posts = await getAllPosts()
|
const posts = await getAllPosts(locale)
|
||||||
const tagMap = new Map<string, number>()
|
const tagMap = new Map<string, number>()
|
||||||
|
|
||||||
posts.forEach(post => {
|
posts.forEach(post => {
|
||||||
@@ -46,8 +46,8 @@ export async function getAllTags(): Promise<TagInfo[]> {
|
|||||||
.sort((a, b) => b.count - a.count)
|
.sort((a, b) => b.count - a.count)
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getPostsByTag(tagSlug: string): Promise<Post[]> {
|
export async function getPostsByTag(tagSlug: string, locale: string = 'en'): Promise<Post[]> {
|
||||||
const posts = await getAllPosts()
|
const posts = await getAllPosts(locale)
|
||||||
|
|
||||||
return posts.filter(post => {
|
return posts.filter(post => {
|
||||||
const tags = post.frontmatter.tags?.filter(Boolean) || []
|
const tags = post.frontmatter.tags?.filter(Boolean) || []
|
||||||
@@ -55,18 +55,18 @@ export async function getPostsByTag(tagSlug: string): Promise<Post[]> {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getTagInfo(tagSlug: string): Promise<TagInfo | null> {
|
export async function getTagInfo(tagSlug: string, locale: string = 'en'): Promise<TagInfo | null> {
|
||||||
const allTags = await getAllTags()
|
const allTags = await getAllTags(locale)
|
||||||
return allTags.find(tag => tag.slug === tagSlug) || null
|
return allTags.find(tag => tag.slug === tagSlug) || null
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getPopularTags(limit = 10): Promise<TagInfo[]> {
|
export async function getPopularTags(locale: string = 'en', limit = 10): Promise<TagInfo[]> {
|
||||||
const allTags = await getAllTags()
|
const allTags = await getAllTags(locale)
|
||||||
return allTags.slice(0, limit)
|
return allTags.slice(0, limit)
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getRelatedTags(tagSlug: string, limit = 5): Promise<TagInfo[]> {
|
export async function getRelatedTags(tagSlug: string, locale: string = 'en', limit = 5): Promise<TagInfo[]> {
|
||||||
const posts = await getPostsByTag(tagSlug)
|
const posts = await getPostsByTag(tagSlug, locale)
|
||||||
const relatedTagMap = new Map<string, number>()
|
const relatedTagMap = new Map<string, number>()
|
||||||
|
|
||||||
posts.forEach(post => {
|
posts.forEach(post => {
|
||||||
@@ -107,8 +107,8 @@ export function validateTags(tags: any): string[] {
|
|||||||
return validTags
|
return validTags
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getTagCloud(): Promise<Array<TagInfo & { size: 'sm' | 'md' | 'lg' | 'xl' }>> {
|
export async function getTagCloud(locale: string = 'en'): Promise<Array<TagInfo & { size: 'sm' | 'md' | 'lg' | 'xl' }>> {
|
||||||
const tags = await getAllTags()
|
const tags = await getAllTags(locale)
|
||||||
if (tags.length === 0) return []
|
if (tags.length === 0) return []
|
||||||
|
|
||||||
const maxCount = Math.max(...tags.map(t => t.count))
|
const maxCount = Math.max(...tags.map(t => t.count))
|
||||||
|
|||||||
@@ -5,12 +5,14 @@ export interface FrontMatter {
|
|||||||
author: string
|
author: string
|
||||||
category: string
|
category: string
|
||||||
tags: string[]
|
tags: string[]
|
||||||
|
locale: string
|
||||||
image?: string
|
image?: string
|
||||||
draft?: boolean
|
draft?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Post {
|
export interface Post {
|
||||||
slug: string
|
slug: string
|
||||||
|
locale: string
|
||||||
frontmatter: FrontMatter
|
frontmatter: FrontMatter
|
||||||
content: string
|
content: string
|
||||||
readingTime: number
|
readingTime: number
|
||||||
|
|||||||
46
lib/utils.ts
46
lib/utils.ts
@@ -1,18 +1,18 @@
|
|||||||
export function formatDate(dateString: string): string {
|
export function formatDate(dateString: string): string {
|
||||||
const date = new Date(dateString)
|
const date = new Date(dateString)
|
||||||
const months = [
|
const months = [
|
||||||
'ianuarie',
|
'January',
|
||||||
'februarie',
|
'February',
|
||||||
'martie',
|
'March',
|
||||||
'aprilie',
|
'April',
|
||||||
'mai',
|
'May',
|
||||||
'iunie',
|
'June',
|
||||||
'iulie',
|
'July',
|
||||||
'august',
|
'August',
|
||||||
'septembrie',
|
'September',
|
||||||
'octombrie',
|
'October',
|
||||||
'noiembrie',
|
'November',
|
||||||
'decembrie',
|
'December',
|
||||||
]
|
]
|
||||||
|
|
||||||
return `${date.getDate()} ${months[date.getMonth()]} ${date.getFullYear()}`
|
return `${date.getDate()} ${months[date.getMonth()]} ${date.getFullYear()}`
|
||||||
@@ -24,12 +24,22 @@ export function formatRelativeDate(dateString: string): string {
|
|||||||
const diffTime = Math.abs(now.getTime() - date.getTime())
|
const diffTime = Math.abs(now.getTime() - date.getTime())
|
||||||
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24))
|
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24))
|
||||||
|
|
||||||
if (diffDays === 0) return 'astăzi'
|
if (diffDays === 0) return 'today'
|
||||||
if (diffDays === 1) return 'ieri'
|
if (diffDays === 1) return 'yesterday'
|
||||||
if (diffDays < 7) return `acum ${diffDays} zile`
|
if (diffDays < 7) {
|
||||||
if (diffDays < 30) return `acum ${Math.floor(diffDays / 7)} săptămâni`
|
const days = diffDays
|
||||||
if (diffDays < 365) return `acum ${Math.floor(diffDays / 30)} luni`
|
return `${days} day${days > 1 ? 's' : ''} ago`
|
||||||
return `acum ${Math.floor(diffDays / 365)} ani`
|
}
|
||||||
|
if (diffDays < 30) {
|
||||||
|
const weeks = Math.floor(diffDays / 7)
|
||||||
|
return `${weeks} week${weeks > 1 ? 's' : ''} ago`
|
||||||
|
}
|
||||||
|
if (diffDays < 365) {
|
||||||
|
const months = Math.floor(diffDays / 30)
|
||||||
|
return `${months} month${months > 1 ? 's' : ''} ago`
|
||||||
|
}
|
||||||
|
const years = Math.floor(diffDays / 365)
|
||||||
|
return `${years} year${years > 1 ? 's' : ''} ago`
|
||||||
}
|
}
|
||||||
|
|
||||||
export function generateExcerpt(content: string, maxLength = 160): string {
|
export function generateExcerpt(content: string, maxLength = 160): string {
|
||||||
|
|||||||
69
messages/en.json
Normal file
69
messages/en.json
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
{
|
||||||
|
"Metadata": {
|
||||||
|
"siteTitle": "Personal Blog",
|
||||||
|
"siteDescription": "Thoughts on technology and development"
|
||||||
|
},
|
||||||
|
|
||||||
|
"Navigation": {
|
||||||
|
"home": "Home",
|
||||||
|
"blog": "Blog",
|
||||||
|
"tags": "Tags",
|
||||||
|
"about": "About"
|
||||||
|
},
|
||||||
|
|
||||||
|
"Breadcrumbs": {
|
||||||
|
"home": "Home",
|
||||||
|
"blog": "Blog",
|
||||||
|
"tags": "Tags",
|
||||||
|
"about": "About"
|
||||||
|
},
|
||||||
|
|
||||||
|
"BlogListing": {
|
||||||
|
"title": "Blog",
|
||||||
|
"subtitle": "Latest articles and thoughts",
|
||||||
|
"searchPlaceholder": "Search articles...",
|
||||||
|
"sortBy": "Sort by",
|
||||||
|
"sortNewest": "Newest",
|
||||||
|
"sortOldest": "Oldest",
|
||||||
|
"sortTitle": "Title",
|
||||||
|
"filterByTag": "Filter by tag",
|
||||||
|
"clearFilters": "Clear filters",
|
||||||
|
"foundPosts": "Found {count} posts",
|
||||||
|
"noPosts": "No posts found"
|
||||||
|
},
|
||||||
|
|
||||||
|
"BlogPost": {
|
||||||
|
"readMore": "Read more",
|
||||||
|
"readingTime": "{minutes} min read",
|
||||||
|
"publishedOn": "Published on {date}",
|
||||||
|
"author": "By {author}",
|
||||||
|
"tags": "Tags",
|
||||||
|
"relatedPosts": "Related Posts",
|
||||||
|
"sharePost": "Share this post"
|
||||||
|
},
|
||||||
|
|
||||||
|
"Tags": {
|
||||||
|
"title": "Tags",
|
||||||
|
"subtitle": "Browse by topic",
|
||||||
|
"allTags": "All Tags",
|
||||||
|
"postsWithTag": "{count} posts tagged with {tag}",
|
||||||
|
"relatedTags": "Related tags",
|
||||||
|
"quickNav": "Quick navigation"
|
||||||
|
},
|
||||||
|
|
||||||
|
"About": {
|
||||||
|
"title": "About",
|
||||||
|
"subtitle": "Learn more about me"
|
||||||
|
},
|
||||||
|
|
||||||
|
"NotFound": {
|
||||||
|
"title": "Page Not Found",
|
||||||
|
"description": "The page you're looking for doesn't exist",
|
||||||
|
"goHome": "Go to homepage"
|
||||||
|
},
|
||||||
|
|
||||||
|
"LanguageSwitcher": {
|
||||||
|
"switchLanguage": "Switch language",
|
||||||
|
"currentLanguage": "Current language"
|
||||||
|
}
|
||||||
|
}
|
||||||
69
messages/ro.json
Normal file
69
messages/ro.json
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
{
|
||||||
|
"Metadata": {
|
||||||
|
"siteTitle": "Blog Personal",
|
||||||
|
"siteDescription": "Gânduri despre tehnologie și dezvoltare"
|
||||||
|
},
|
||||||
|
|
||||||
|
"Navigation": {
|
||||||
|
"home": "Acasă",
|
||||||
|
"blog": "Blog",
|
||||||
|
"tags": "Etichete",
|
||||||
|
"about": "Despre"
|
||||||
|
},
|
||||||
|
|
||||||
|
"Breadcrumbs": {
|
||||||
|
"home": "Acasă",
|
||||||
|
"blog": "Blog",
|
||||||
|
"tags": "Etichete",
|
||||||
|
"about": "Despre"
|
||||||
|
},
|
||||||
|
|
||||||
|
"BlogListing": {
|
||||||
|
"title": "Blog",
|
||||||
|
"subtitle": "Ultimele articole și gânduri",
|
||||||
|
"searchPlaceholder": "Caută articole...",
|
||||||
|
"sortBy": "Sortează după",
|
||||||
|
"sortNewest": "Cele mai noi",
|
||||||
|
"sortOldest": "Cele mai vechi",
|
||||||
|
"sortTitle": "Titlu",
|
||||||
|
"filterByTag": "Filtrează după etichetă",
|
||||||
|
"clearFilters": "Șterge filtrele",
|
||||||
|
"foundPosts": "{count} articole găsite",
|
||||||
|
"noPosts": "Niciun articol găsit"
|
||||||
|
},
|
||||||
|
|
||||||
|
"BlogPost": {
|
||||||
|
"readMore": "Citește mai mult",
|
||||||
|
"readingTime": "{minutes} min citire",
|
||||||
|
"publishedOn": "Publicat pe {date}",
|
||||||
|
"author": "De {author}",
|
||||||
|
"tags": "Etichete",
|
||||||
|
"relatedPosts": "Articole similare",
|
||||||
|
"sharePost": "Distribuie acest articol"
|
||||||
|
},
|
||||||
|
|
||||||
|
"Tags": {
|
||||||
|
"title": "Etichete",
|
||||||
|
"subtitle": "Navighează după subiect",
|
||||||
|
"allTags": "Toate etichetele",
|
||||||
|
"postsWithTag": "{count} articole cu eticheta {tag}",
|
||||||
|
"relatedTags": "Etichete similare",
|
||||||
|
"quickNav": "Navigare rapidă"
|
||||||
|
},
|
||||||
|
|
||||||
|
"About": {
|
||||||
|
"title": "Despre",
|
||||||
|
"subtitle": "Află mai multe despre mine"
|
||||||
|
},
|
||||||
|
|
||||||
|
"NotFound": {
|
||||||
|
"title": "Pagina nu a fost găsită",
|
||||||
|
"description": "Pagina pe care o cauți nu există",
|
||||||
|
"goHome": "Mergi la pagina principală"
|
||||||
|
},
|
||||||
|
|
||||||
|
"LanguageSwitcher": {
|
||||||
|
"switchLanguage": "Schimbă limba",
|
||||||
|
"currentLanguage": "Limba curentă"
|
||||||
|
}
|
||||||
|
}
|
||||||
20
middleware.ts
Normal file
20
middleware.ts
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
import createMiddleware from 'next-intl/middleware';
|
||||||
|
import {routing} from './src/i18n/routing';
|
||||||
|
|
||||||
|
export default createMiddleware({
|
||||||
|
...routing,
|
||||||
|
localeDetection: true,
|
||||||
|
localeCookie: {
|
||||||
|
name: 'NEXT_LOCALE',
|
||||||
|
maxAge: 60 * 60 * 24 * 365,
|
||||||
|
sameSite: 'lax'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export const config = {
|
||||||
|
matcher: [
|
||||||
|
'/',
|
||||||
|
'/(en|ro)/:path*',
|
||||||
|
'/((?!api|_next|_vercel|.*\\..*).*)'
|
||||||
|
]
|
||||||
|
};
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
const withNextIntl = require('next-intl/plugin')();
|
||||||
|
|
||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
// ============================================
|
// ============================================
|
||||||
// Next.js 16 Configuration
|
// Next.js 16 Configuration
|
||||||
@@ -70,7 +72,6 @@ const nextConfig = {
|
|||||||
// Performance Optimization
|
// Performance Optimization
|
||||||
// ============================================
|
// ============================================
|
||||||
|
|
||||||
|
|
||||||
// Compress static pages (reduces bandwidth)
|
// Compress static pages (reduces bandwidth)
|
||||||
compress: true,
|
compress: true,
|
||||||
|
|
||||||
@@ -246,4 +247,4 @@ const nextConfig = {
|
|||||||
// },
|
// },
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = nextConfig
|
module.exports = withNextIntl(nextConfig)
|
||||||
|
|||||||
374
package-lock.json
generated
374
package-lock.json
generated
@@ -16,6 +16,7 @@
|
|||||||
"autoprefixer": "^10.4.21",
|
"autoprefixer": "^10.4.21",
|
||||||
"gray-matter": "^4.0.3",
|
"gray-matter": "^4.0.3",
|
||||||
"next": "^16.0.1",
|
"next": "^16.0.1",
|
||||||
|
"next-intl": "^4.5.7",
|
||||||
"next-themes": "^0.4.6",
|
"next-themes": "^0.4.6",
|
||||||
"postcss": "^8.5.6",
|
"postcss": "^8.5.6",
|
||||||
"react": "^19.2.0",
|
"react": "^19.2.0",
|
||||||
@@ -566,6 +567,66 @@
|
|||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@formatjs/ecma402-abstract": {
|
||||||
|
"version": "2.3.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-2.3.6.tgz",
|
||||||
|
"integrity": "sha512-HJnTFeRM2kVFVr5gr5kH1XP6K0JcJtE7Lzvtr3FS/so5f1kpsqqqxy5JF+FRaO6H2qmcMfAUIox7AJteieRtVw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@formatjs/fast-memoize": "2.2.7",
|
||||||
|
"@formatjs/intl-localematcher": "0.6.2",
|
||||||
|
"decimal.js": "^10.4.3",
|
||||||
|
"tslib": "^2.8.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@formatjs/ecma402-abstract/node_modules/@formatjs/intl-localematcher": {
|
||||||
|
"version": "0.6.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.6.2.tgz",
|
||||||
|
"integrity": "sha512-XOMO2Hupl0wdd172Y06h6kLpBz6Dv+J4okPLl4LPtzbr8f66WbIoy4ev98EBuZ6ZK4h5ydTN6XneT4QVpD7cdA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"tslib": "^2.8.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@formatjs/fast-memoize": {
|
||||||
|
"version": "2.2.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/@formatjs/fast-memoize/-/fast-memoize-2.2.7.tgz",
|
||||||
|
"integrity": "sha512-Yabmi9nSvyOMrlSeGGWDiH7rf3a7sIwplbvo/dlz9WCIjzIQAfy1RMf4S0X3yG724n5Ghu2GmEl5NJIV6O9sZQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"tslib": "^2.8.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@formatjs/icu-messageformat-parser": {
|
||||||
|
"version": "2.11.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.11.4.tgz",
|
||||||
|
"integrity": "sha512-7kR78cRrPNB4fjGFZg3Rmj5aah8rQj9KPzuLsmcSn4ipLXQvC04keycTI1F7kJYDwIXtT2+7IDEto842CfZBtw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@formatjs/ecma402-abstract": "2.3.6",
|
||||||
|
"@formatjs/icu-skeleton-parser": "1.8.16",
|
||||||
|
"tslib": "^2.8.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@formatjs/icu-skeleton-parser": {
|
||||||
|
"version": "1.8.16",
|
||||||
|
"resolved": "https://registry.npmjs.org/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.8.16.tgz",
|
||||||
|
"integrity": "sha512-H13E9Xl+PxBd8D5/6TVUluSpxGNvFSlN/b3coUp0e0JpuWXXnQDiavIpY3NnvSp4xhEMoXyyBvVfdFX8jglOHQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@formatjs/ecma402-abstract": "2.3.6",
|
||||||
|
"tslib": "^2.8.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@formatjs/intl-localematcher": {
|
||||||
|
"version": "0.5.10",
|
||||||
|
"resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.5.10.tgz",
|
||||||
|
"integrity": "sha512-af3qATX+m4Rnd9+wHcjJ4w2ijq+rAVP3CCinJQvFv1kgSu1W6jypUmvleJxcewdxmutM8dmIRZFxO/IQBZmP2Q==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"tslib": "2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@humanfs/core": {
|
"node_modules/@humanfs/core": {
|
||||||
"version": "0.19.1",
|
"version": "0.19.1",
|
||||||
"resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz",
|
"resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz",
|
||||||
@@ -1399,6 +1460,178 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/@schummar/icu-type-parser": {
|
||||||
|
"version": "1.21.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@schummar/icu-type-parser/-/icu-type-parser-1.21.5.tgz",
|
||||||
|
"integrity": "sha512-bXHSaW5jRTmke9Vd0h5P7BtWZG9Znqb8gSDxZnxaGSJnGwPLDPfS+3g0BKzeWqzgZPsIVZkM7m2tbo18cm5HBw==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/@swc/core-darwin-arm64": {
|
||||||
|
"version": "1.15.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.15.3.tgz",
|
||||||
|
"integrity": "sha512-AXfeQn0CvcQ4cndlIshETx6jrAM45oeUrK8YeEY6oUZU/qzz0Id0CyvlEywxkWVC81Ajpd8TQQ1fW5yx6zQWkQ==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"license": "Apache-2.0 AND MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"darwin"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@swc/core-darwin-x64": {
|
||||||
|
"version": "1.15.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.15.3.tgz",
|
||||||
|
"integrity": "sha512-p68OeCz1ui+MZYG4wmfJGvcsAcFYb6Sl25H9TxWl+GkBgmNimIiRdnypK9nBGlqMZAcxngNPtnG3kEMNnvoJ2A==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"license": "Apache-2.0 AND MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"darwin"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@swc/core-linux-arm-gnueabihf": {
|
||||||
|
"version": "1.15.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.15.3.tgz",
|
||||||
|
"integrity": "sha512-Nuj5iF4JteFgwrai97mUX+xUOl+rQRHqTvnvHMATL/l9xE6/TJfPBpd3hk/PVpClMXG3Uvk1MxUFOEzM1JrMYg==",
|
||||||
|
"cpu": [
|
||||||
|
"arm"
|
||||||
|
],
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@swc/core-linux-arm64-gnu": {
|
||||||
|
"version": "1.15.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.15.3.tgz",
|
||||||
|
"integrity": "sha512-2Nc/s8jE6mW2EjXWxO/lyQuLKShcmTrym2LRf5Ayp3ICEMX6HwFqB1EzDhwoMa2DcUgmnZIalesq2lG3krrUNw==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"license": "Apache-2.0 AND MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@swc/core-linux-arm64-musl": {
|
||||||
|
"version": "1.15.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.15.3.tgz",
|
||||||
|
"integrity": "sha512-j4SJniZ/qaZ5g8op+p1G9K1z22s/EYGg1UXIb3+Cg4nsxEpF5uSIGEE4mHUfA70L0BR9wKT2QF/zv3vkhfpX4g==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"license": "Apache-2.0 AND MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@swc/core-linux-x64-gnu": {
|
||||||
|
"version": "1.15.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.15.3.tgz",
|
||||||
|
"integrity": "sha512-aKttAZnz8YB1VJwPQZtyU8Uk0BfMP63iDMkvjhJzRZVgySmqt/apWSdnoIcZlUoGheBrcqbMC17GGUmur7OT5A==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"license": "Apache-2.0 AND MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@swc/core-linux-x64-musl": {
|
||||||
|
"version": "1.15.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.15.3.tgz",
|
||||||
|
"integrity": "sha512-oe8FctPu1gnUsdtGJRO2rvOUIkkIIaHqsO9xxN0bTR7dFTlPTGi2Fhk1tnvXeyAvCPxLIcwD8phzKg6wLv9yug==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"license": "Apache-2.0 AND MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@swc/core-win32-arm64-msvc": {
|
||||||
|
"version": "1.15.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.15.3.tgz",
|
||||||
|
"integrity": "sha512-L9AjzP2ZQ/Xh58e0lTRMLvEDrcJpR7GwZqAtIeNLcTK7JVE+QineSyHp0kLkO1rttCHyCy0U74kDTj0dRz6raA==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"license": "Apache-2.0 AND MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"win32"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@swc/core-win32-ia32-msvc": {
|
||||||
|
"version": "1.15.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.15.3.tgz",
|
||||||
|
"integrity": "sha512-B8UtogMzErUPDWUoKONSVBdsgKYd58rRyv2sHJWKOIMCHfZ22FVXICR4O/VwIYtlnZ7ahERcjayBHDlBZpR0aw==",
|
||||||
|
"cpu": [
|
||||||
|
"ia32"
|
||||||
|
],
|
||||||
|
"license": "Apache-2.0 AND MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"win32"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@swc/core-win32-x64-msvc": {
|
||||||
|
"version": "1.15.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.15.3.tgz",
|
||||||
|
"integrity": "sha512-SpZKMR9QBTecHeqpzJdYEfgw30Oo8b/Xl6rjSzBt1g0ZsXyy60KLXrp6IagQyfTYqNYE/caDvwtF2FPn7pomog==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"license": "Apache-2.0 AND MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"win32"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@swc/counter": {
|
||||||
|
"version": "0.1.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/@swc/counter/-/counter-0.1.3.tgz",
|
||||||
|
"integrity": "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==",
|
||||||
|
"license": "Apache-2.0"
|
||||||
|
},
|
||||||
"node_modules/@swc/helpers": {
|
"node_modules/@swc/helpers": {
|
||||||
"version": "0.5.15",
|
"version": "0.5.15",
|
||||||
"resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz",
|
"resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz",
|
||||||
@@ -1408,6 +1641,15 @@
|
|||||||
"tslib": "^2.8.0"
|
"tslib": "^2.8.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@swc/types": {
|
||||||
|
"version": "0.1.25",
|
||||||
|
"resolved": "https://registry.npmjs.org/@swc/types/-/types-0.1.25.tgz",
|
||||||
|
"integrity": "sha512-iAoY/qRhNH8a/hBvm3zKj9qQ4oc2+3w1unPJa2XvTK3XjeLXtzcCingVPw/9e5mn1+0yPqxcBGp9Jf0pkfMb1g==",
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"dependencies": {
|
||||||
|
"@swc/counter": "^0.1.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@tailwindcss/node": {
|
"node_modules/@tailwindcss/node": {
|
||||||
"version": "4.1.17",
|
"version": "4.1.17",
|
||||||
"resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.1.17.tgz",
|
"resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.1.17.tgz",
|
||||||
@@ -3027,6 +3269,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/decimal.js": {
|
||||||
|
"version": "10.6.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.6.0.tgz",
|
||||||
|
"integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/decode-named-character-reference": {
|
"node_modules/decode-named-character-reference": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.2.0.tgz",
|
||||||
@@ -4809,6 +5057,18 @@
|
|||||||
"node": ">= 0.4"
|
"node": ">= 0.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/intl-messageformat": {
|
||||||
|
"version": "10.7.18",
|
||||||
|
"resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-10.7.18.tgz",
|
||||||
|
"integrity": "sha512-m3Ofv/X/tV8Y3tHXLohcuVuhWKo7BBq62cqY15etqmLxg2DZ34AGGgQDeR+SCta2+zICb1NX83af0GJmbQ1++g==",
|
||||||
|
"license": "BSD-3-Clause",
|
||||||
|
"dependencies": {
|
||||||
|
"@formatjs/ecma402-abstract": "2.3.6",
|
||||||
|
"@formatjs/fast-memoize": "2.2.7",
|
||||||
|
"@formatjs/icu-messageformat-parser": "2.11.4",
|
||||||
|
"tslib": "^2.8.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/is-alphabetical": {
|
"node_modules/is-alphabetical": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-2.0.1.tgz",
|
||||||
@@ -6737,6 +6997,15 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/negotiator": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/next": {
|
"node_modules/next": {
|
||||||
"version": "16.0.1",
|
"version": "16.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/next/-/next-16.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/next/-/next-16.0.1.tgz",
|
||||||
@@ -6789,6 +7058,91 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/next-intl": {
|
||||||
|
"version": "4.5.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/next-intl/-/next-intl-4.5.7.tgz",
|
||||||
|
"integrity": "sha512-7iT9rBEFZvsJI5uLoOLgI1kAieg1k7zCwbuby6ylKRbpvt08I1vkZ5FJnIBey1M+r1jam/wANlnqRYeJagjL2Q==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "individual",
|
||||||
|
"url": "https://github.com/sponsors/amannn"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@formatjs/intl-localematcher": "^0.5.4",
|
||||||
|
"@swc/core": "^1.15.2",
|
||||||
|
"negotiator": "^1.0.0",
|
||||||
|
"next-intl-swc-plugin-extractor": "^4.5.7",
|
||||||
|
"po-parser": "^1.0.2",
|
||||||
|
"use-intl": "^4.5.7"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"next": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0",
|
||||||
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0 || ^19.0.0",
|
||||||
|
"typescript": "^5.0.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"typescript": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/next-intl-swc-plugin-extractor": {
|
||||||
|
"version": "4.5.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/next-intl-swc-plugin-extractor/-/next-intl-swc-plugin-extractor-4.5.7.tgz",
|
||||||
|
"integrity": "sha512-cSHtDpEoSHuEC4CzUDmAAfB0H3fqSephpJNd/GtS9LvUoZM78wJQwkEaqN9yTxXEvJ8uQG60nnOeSl2LQU9qdQ==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/next-intl/node_modules/@swc/core": {
|
||||||
|
"version": "1.15.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/@swc/core/-/core-1.15.3.tgz",
|
||||||
|
"integrity": "sha512-Qd8eBPkUFL4eAONgGjycZXj1jFCBW8Fd+xF0PzdTlBCWQIV1xnUT7B93wUANtW3KGjl3TRcOyxwSx/u/jyKw/Q==",
|
||||||
|
"hasInstallScript": true,
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"dependencies": {
|
||||||
|
"@swc/counter": "^0.1.3",
|
||||||
|
"@swc/types": "^0.1.25"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/swc"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"@swc/core-darwin-arm64": "1.15.3",
|
||||||
|
"@swc/core-darwin-x64": "1.15.3",
|
||||||
|
"@swc/core-linux-arm-gnueabihf": "1.15.3",
|
||||||
|
"@swc/core-linux-arm64-gnu": "1.15.3",
|
||||||
|
"@swc/core-linux-arm64-musl": "1.15.3",
|
||||||
|
"@swc/core-linux-x64-gnu": "1.15.3",
|
||||||
|
"@swc/core-linux-x64-musl": "1.15.3",
|
||||||
|
"@swc/core-win32-arm64-msvc": "1.15.3",
|
||||||
|
"@swc/core-win32-ia32-msvc": "1.15.3",
|
||||||
|
"@swc/core-win32-x64-msvc": "1.15.3"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@swc/helpers": ">=0.5.17"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"@swc/helpers": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/next-intl/node_modules/@swc/helpers": {
|
||||||
|
"version": "0.5.17",
|
||||||
|
"resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.17.tgz",
|
||||||
|
"integrity": "sha512-5IKx/Y13RsYd+sauPb2x+U/xZikHjolzfuDgTAl/Tdf3Q8rslRvC19NKDLgAJQ6wsqADk10ntlv08nPFw/gO/A==",
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"optional": true,
|
||||||
|
"peer": true,
|
||||||
|
"dependencies": {
|
||||||
|
"tslib": "^2.8.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/next-themes": {
|
"node_modules/next-themes": {
|
||||||
"version": "0.4.6",
|
"version": "0.4.6",
|
||||||
"resolved": "https://registry.npmjs.org/next-themes/-/next-themes-0.4.6.tgz",
|
"resolved": "https://registry.npmjs.org/next-themes/-/next-themes-0.4.6.tgz",
|
||||||
@@ -7139,6 +7493,12 @@
|
|||||||
"url": "https://github.com/sponsors/jonschlinkert"
|
"url": "https://github.com/sponsors/jonschlinkert"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/po-parser": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/po-parser/-/po-parser-1.0.2.tgz",
|
||||||
|
"integrity": "sha512-yTIQL8PZy7V8c0psPoJUx7fayez+Mo/53MZgX9MPuPHx+Dt+sRPNuRbI+6Oqxnddhkd68x4Nlgon/zizL1Xg+w==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/possible-typed-array-names": {
|
"node_modules/possible-typed-array-names": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz",
|
||||||
@@ -8625,6 +8985,20 @@
|
|||||||
"punycode": "^2.1.0"
|
"punycode": "^2.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/use-intl": {
|
||||||
|
"version": "4.5.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/use-intl/-/use-intl-4.5.7.tgz",
|
||||||
|
"integrity": "sha512-WBVD1fxV9td5osQFK0TRQhz217zHERhxBuA3EmZuH7wCINJPXbYPs+0FH2oMpy6p6BBwuHCJK2ER8hKwxf0LQA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@formatjs/fast-memoize": "^2.2.0",
|
||||||
|
"@schummar/icu-type-parser": "1.21.5",
|
||||||
|
"intl-messageformat": "^10.5.14"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"react": "^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0 || ^19.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/util-deprecate": {
|
"node_modules/util-deprecate": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
"autoprefixer": "^10.4.21",
|
"autoprefixer": "^10.4.21",
|
||||||
"gray-matter": "^4.0.3",
|
"gray-matter": "^4.0.3",
|
||||||
"next": "^16.0.1",
|
"next": "^16.0.1",
|
||||||
|
"next-intl": "^4.5.7",
|
||||||
"next-themes": "^0.4.6",
|
"next-themes": "^0.4.6",
|
||||||
"postcss": "^8.5.6",
|
"postcss": "^8.5.6",
|
||||||
"react": "^19.2.0",
|
"react": "^19.2.0",
|
||||||
|
|||||||
5
src/i18n/navigation.ts
Normal file
5
src/i18n/navigation.ts
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import {createNavigation} from 'next-intl/navigation';
|
||||||
|
import {routing} from './routing';
|
||||||
|
|
||||||
|
export const {Link, redirect, usePathname, useRouter} =
|
||||||
|
createNavigation(routing);
|
||||||
15
src/i18n/request.ts
Normal file
15
src/i18n/request.ts
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import {getRequestConfig} from 'next-intl/server';
|
||||||
|
import {routing} from './routing';
|
||||||
|
|
||||||
|
export default getRequestConfig(async ({requestLocale}) => {
|
||||||
|
let locale = await requestLocale;
|
||||||
|
|
||||||
|
if (!locale || !routing.locales.includes(locale as any)) {
|
||||||
|
locale = routing.defaultLocale;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
locale,
|
||||||
|
messages: (await import(`../../messages/${locale}.json`)).default
|
||||||
|
};
|
||||||
|
});
|
||||||
13
src/i18n/routing.ts
Normal file
13
src/i18n/routing.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import {defineRouting} from 'next-intl/routing';
|
||||||
|
|
||||||
|
export const routing = defineRouting({
|
||||||
|
locales: ['en', 'ro'],
|
||||||
|
defaultLocale: 'en',
|
||||||
|
localePrefix: 'always',
|
||||||
|
localeNames: {
|
||||||
|
en: 'English',
|
||||||
|
ro: 'Română'
|
||||||
|
}
|
||||||
|
} as any);
|
||||||
|
|
||||||
|
export type Locale = (typeof routing.locales)[number];
|
||||||
@@ -1,7 +1,11 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ES2020",
|
"target": "ES2020",
|
||||||
"lib": ["dom", "dom.iterable", "esnext"],
|
"lib": [
|
||||||
|
"dom",
|
||||||
|
"dom.iterable",
|
||||||
|
"esnext"
|
||||||
|
],
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
@@ -19,7 +23,12 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["./*"]
|
"@/*": [
|
||||||
|
"./*"
|
||||||
|
],
|
||||||
|
"@/i18n/*": [
|
||||||
|
"./src/i18n/*"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
@@ -29,5 +38,7 @@
|
|||||||
".next/types/**/*.ts",
|
".next/types/**/*.ts",
|
||||||
".next/dev/types/**/*.ts"
|
".next/dev/types/**/*.ts"
|
||||||
],
|
],
|
||||||
"exclude": ["node_modules"]
|
"exclude": [
|
||||||
|
"node_modules"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
5
types/translations.d.ts
vendored
Normal file
5
types/translations.d.ts
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
type Messages = typeof import('../messages/en.json');
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface IntlMessages extends Messages {}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user