This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import type { Metadata } from "next";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { getLocale, getTranslations } from "next-intl/server";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import { Container } from "@/components/layout/container";
|
||||
@@ -8,7 +8,7 @@ import { PortfolioCategoryFilter } from "@/components/site/portfolio-category-fi
|
||||
import { PortfolioProjectGrid } from "@/components/site/portfolio-project-grid";
|
||||
import { getSiteSettings } from "@/lib/app-config";
|
||||
import { buildLocalizedMetadata } from "@/lib/metadata";
|
||||
import { FALLBACK_LOCALE, getLocalizedPath, resolveLocale } from "@/lib/locale";
|
||||
import { getLocalizedPath, resolveLocale } from "@/lib/locale";
|
||||
import { getActivePortfolioCategories, getPublishedPortfolioProjects } from "@/lib/portfolio";
|
||||
|
||||
type PortfolioPageProps = {
|
||||
@@ -23,8 +23,9 @@ type PortfolioPageProps = {
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export async function generateMetadata({ params }: PortfolioPageProps): Promise<Metadata> {
|
||||
const { locale } = await params;
|
||||
const localeKey = resolveLocale(locale, FALLBACK_LOCALE);
|
||||
await params;
|
||||
const siteSettings = await getSiteSettings();
|
||||
const localeKey = resolveLocale(await getLocale().catch(() => siteSettings.defaultLocale), siteSettings.defaultLocale);
|
||||
const t = await getTranslations({ locale: localeKey, namespace: "portfolioPage" });
|
||||
|
||||
return await buildLocalizedMetadata({
|
||||
@@ -43,11 +44,9 @@ export default async function PortfolioPage({
|
||||
params,
|
||||
searchParams,
|
||||
]);
|
||||
const localeKey = resolveLocale(locale, FALLBACK_LOCALE);
|
||||
const [t, siteSettings] = await Promise.all([
|
||||
getTranslations({ locale: localeKey, namespace: "portfolioPage" }),
|
||||
getSiteSettings(),
|
||||
]);
|
||||
const siteSettings = await getSiteSettings();
|
||||
const localeKey = resolveLocale(await getLocale().catch(() => locale), siteSettings.defaultLocale);
|
||||
const t = await getTranslations({ locale: localeKey, namespace: "portfolioPage" });
|
||||
const selectedCategory = resolvedSearchParams?.category ?? "";
|
||||
|
||||
if (selectedCategory) {
|
||||
|
||||
Reference in New Issue
Block a user