📝 priettier check
All checks were successful
PR Checks / lint-and-build (pull_request) Successful in 18s
All checks were successful
PR Checks / lint-and-build (pull_request) Successful in 18s
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Metadata } from 'next'
|
||||
import { Navbar } from '@/components/blog/navbar'
|
||||
import {setRequestLocale, getTranslations} from 'next-intl/server'
|
||||
import { setRequestLocale, getTranslations } from 'next-intl/server'
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'About',
|
||||
@@ -8,11 +8,11 @@ export const metadata: Metadata = {
|
||||
}
|
||||
|
||||
type Props = {
|
||||
params: Promise<{locale: string}>
|
||||
params: Promise<{ locale: string }>
|
||||
}
|
||||
|
||||
export default async function AboutPage({params}: Props) {
|
||||
const {locale} = await params
|
||||
export default async function AboutPage({ params }: Props) {
|
||||
const { locale } = await params
|
||||
setRequestLocale(locale)
|
||||
const t = await getTranslations('About')
|
||||
return (
|
||||
|
||||
@@ -9,9 +9,7 @@ export default function NotFound() {
|
||||
<div className="text-center">
|
||||
<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">{t('title')}</h2>
|
||||
<p className="text-gray-600 dark:text-gray-400 mb-8">
|
||||
{t('description')}
|
||||
</p>
|
||||
<p className="text-gray-600 dark:text-gray-400 mb-8">{t('description')}</p>
|
||||
<div className="space-x-4">
|
||||
<Link
|
||||
href="/blog"
|
||||
|
||||
@@ -68,10 +68,10 @@ export default function BlogPageClient({ posts, allTags }: BlogPageClientProps)
|
||||
{/* Header */}
|
||||
<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">
|
||||
{t("subtitle")}
|
||||
{t('subtitle')}
|
||||
</p>
|
||||
<h1 className="text-4xl md:text-6xl font-mono font-bold text-[rgb(var(--text-primary))] uppercase tracking-tight">
|
||||
> {t("title")}_
|
||||
> {t('title')}_
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
@@ -103,8 +103,7 @@ export default function BlogPageClient({ posts, allTags }: BlogPageClientProps)
|
||||
{/* Results Count */}
|
||||
<div className="mb-6">
|
||||
<p className="font-mono text-sm text-[rgb(var(--text-muted))] uppercase">
|
||||
{t("foundPosts", {count: filteredAndSortedPosts.length})}{' '}
|
||||
|
||||
{t('foundPosts', { count: filteredAndSortedPosts.length })}{' '}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -127,7 +126,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">
|
||||
<p className="font-mono text-lg text-[rgb(var(--text-muted))] uppercase">
|
||||
{t("noPosts")}
|
||||
{t('noPosts')}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -3,7 +3,7 @@ import BlogPageClient from './blog-client'
|
||||
import { setRequestLocale } from 'next-intl/server'
|
||||
|
||||
export default async function BlogPage({ params }: { params: Promise<{ locale: string }> }) {
|
||||
const { locale } = await params;
|
||||
const { locale } = await params
|
||||
await setRequestLocale(locale)
|
||||
const posts = await getAllPosts(locale)
|
||||
const allTags = Array.from(new Set(posts.flatMap(post => post.frontmatter.tags))).sort()
|
||||
|
||||
@@ -1,25 +1,21 @@
|
||||
import {notFound} from 'next/navigation'
|
||||
import {setRequestLocale} from 'next-intl/server'
|
||||
import {routing} from '@/src/i18n/routing'
|
||||
import {ReactNode} from 'react'
|
||||
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}>
|
||||
params: Promise<{ locale: string }>
|
||||
}
|
||||
|
||||
export function generateStaticParams() {
|
||||
return routing.locales.map((locale) => ({locale}))
|
||||
return routing.locales.map(locale => ({ locale }))
|
||||
}
|
||||
|
||||
export default async function LocaleLayout({
|
||||
children,
|
||||
breadcrumbs,
|
||||
params
|
||||
}: Props) {
|
||||
const {locale} = await params
|
||||
|
||||
export default async function LocaleLayout({ children, breadcrumbs, params }: Props) {
|
||||
const { locale } = await params
|
||||
|
||||
if (!routing.locales.includes(locale as any)) {
|
||||
notFound()
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import {Link} from '@/src/i18n/navigation'
|
||||
import { Link } from '@/src/i18n/navigation'
|
||||
import Image from 'next/image'
|
||||
import { getAllPosts } from '@/lib/markdown'
|
||||
import { formatDate } from '@/lib/utils'
|
||||
import { ThemeToggle } from '@/components/theme-toggle'
|
||||
import {setRequestLocale, getTranslations} from 'next-intl/server'
|
||||
import { setRequestLocale, getTranslations } from 'next-intl/server'
|
||||
|
||||
type Props = {
|
||||
params: Promise<{locale: string}>
|
||||
params: Promise<{ locale: string }>
|
||||
}
|
||||
|
||||
export default async function HomePage({params}: Props) {
|
||||
const {locale} = await params
|
||||
export default async function HomePage({ params }: Props) {
|
||||
const { locale } = await params
|
||||
setRequestLocale(locale)
|
||||
const t = await getTranslations('Home')
|
||||
const tNav = await getTranslations('Navigation')
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { Metadata } from 'next'
|
||||
import { notFound } from 'next/navigation'
|
||||
import {Link} from '@/src/i18n/navigation'
|
||||
import { Link } from '@/src/i18n/navigation'
|
||||
import { getAllTags, getPostsByTag, getTagInfo, getRelatedTags } from '@/lib/tags'
|
||||
import { TagList } from '@/components/blog/tag-list'
|
||||
import { formatDate } from '@/lib/utils'
|
||||
import {setRequestLocale} from 'next-intl/server'
|
||||
import {routing} from '@/src/i18n/routing'
|
||||
import { setRequestLocale } from 'next-intl/server'
|
||||
import { routing } from '@/src/i18n/routing'
|
||||
|
||||
export async function generateStaticParams() {
|
||||
const tags = await getAllTags()
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Metadata } from 'next'
|
||||
import {Link} from '@/src/i18n/navigation'
|
||||
import { Link } from '@/src/i18n/navigation'
|
||||
import { getAllTags, getTagCloud } from '@/lib/tags'
|
||||
import { TagCloud } from '@/components/blog/tag-cloud'
|
||||
import { TagBadge } from '@/components/blog/tag-badge'
|
||||
import {setRequestLocale} from 'next-intl/server'
|
||||
import { setRequestLocale } from 'next-intl/server'
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'Tag-uri',
|
||||
@@ -11,11 +11,11 @@ export const metadata: Metadata = {
|
||||
}
|
||||
|
||||
type Props = {
|
||||
params: Promise<{locale: string}>
|
||||
params: Promise<{ locale: string }>
|
||||
}
|
||||
|
||||
export default async function TagsPage({params}: Props) {
|
||||
const {locale} = await params
|
||||
export default async function TagsPage({ params }: Props) {
|
||||
const { locale } = await params
|
||||
setRequestLocale(locale)
|
||||
const allTags = await getAllTags()
|
||||
const tagCloud = await getTagCloud()
|
||||
|
||||
@@ -3,7 +3,7 @@ import { NextResponse } from 'next/server'
|
||||
|
||||
export async function GET() {
|
||||
const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || 'http://localhost:3030'
|
||||
const posts = await getAllPosts("en", false)
|
||||
const posts = await getAllPosts('en', false)
|
||||
|
||||
const rss = `<?xml version="1.0" encoding="UTF-8"?>
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
|
||||
@@ -3,8 +3,8 @@ import { JetBrains_Mono } from 'next/font/google'
|
||||
import './globals.css'
|
||||
import { ThemeProvider } from '@/providers/providers'
|
||||
import '@/lib/env-validation'
|
||||
import {NextIntlClientProvider} from 'next-intl'
|
||||
import {getMessages} from 'next-intl/server'
|
||||
import { NextIntlClientProvider } from 'next-intl'
|
||||
import { getMessages } from 'next-intl/server'
|
||||
|
||||
const jetbrainsMono = JetBrains_Mono({ subsets: ['latin'], variable: '--font-mono' })
|
||||
|
||||
@@ -30,11 +30,7 @@ export const metadata: Metadata = {
|
||||
},
|
||||
}
|
||||
|
||||
export default async function RootLayout({
|
||||
children
|
||||
}: {
|
||||
children: React.ReactNode
|
||||
}) {
|
||||
export default async function RootLayout({ children }: { children: React.ReactNode }) {
|
||||
const messages = await getMessages()
|
||||
|
||||
return (
|
||||
|
||||
@@ -2,15 +2,15 @@ import { MetadataRoute } from 'next'
|
||||
|
||||
export default function robots(): MetadataRoute.Robots {
|
||||
const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || 'http://localhost:3030'
|
||||
|
||||
|
||||
return {
|
||||
rules: {
|
||||
userAgent: '*',
|
||||
allow: '/',
|
||||
disallow: [
|
||||
'/api/', // Disallow API routes (if any)
|
||||
'/_next/', // Disallow Next.js internals
|
||||
'/admin/', // Disallow admin (if any)
|
||||
'/api/', // Disallow API routes (if any)
|
||||
'/_next/', // Disallow Next.js internals
|
||||
'/admin/', // Disallow admin (if any)
|
||||
],
|
||||
},
|
||||
sitemap: `${baseUrl}/sitemap.xml`,
|
||||
|
||||
@@ -3,10 +3,10 @@ import { getAllPosts } from '@/lib/markdown'
|
||||
|
||||
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
||||
const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || 'http://localhost:3030'
|
||||
|
||||
|
||||
// Get all blog posts
|
||||
const posts = await getAllPosts("en", false)
|
||||
|
||||
const posts = await getAllPosts('en', false)
|
||||
|
||||
// Generate sitemap entries for blog posts
|
||||
const blogPosts: MetadataRoute.Sitemap = posts.map(post => ({
|
||||
url: `${baseUrl}/blog/${post.slug}`,
|
||||
@@ -14,7 +14,7 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
||||
changeFrequency: 'monthly' as const,
|
||||
priority: 0.8,
|
||||
}))
|
||||
|
||||
|
||||
// Static pages
|
||||
const staticPages: MetadataRoute.Sitemap = [
|
||||
{
|
||||
@@ -36,6 +36,6 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
||||
priority: 0.7,
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
return [...staticPages, ...blogPosts]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user