Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 38 additions & 3 deletions src/app/[locale]/(auth)/(center)/sign-in/[[...sign-in]]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Metadata } from 'next';
import { SignIn } from '@clerk/nextjs';
import { getTranslations, setRequestLocale } from 'next-intl/server';
import { getI18nPath } from '@/utils/Helpers';
import { generateMetadataUrl, getI18nPath, getOgImagePath, getOpenGraphLocale } from '@/utils/Helpers';

type ISignInPageProps = {
params: Promise<{ locale: string }>;
Expand All @@ -14,9 +14,44 @@ export async function generateMetadata(props: ISignInPageProps): Promise<Metadat
namespace: 'SignIn',
});

const title = t('meta_title');
const description = t('meta_description');
const url = generateMetadataUrl('/sign-in', locale);

return {
title: t('meta_title'),
description: t('meta_description'),
title,
description,
openGraph: {
title,
description,
url,
siteName: 'Next.js Boilerplate',
images: [
{
url: getOgImagePath('auth'),
width: 1200,
height: 630,
alt: title,
},
],
locale: getOpenGraphLocale(locale),
type: 'website',
},
twitter: {
card: 'summary_large_image',
title,
description,
images: [getOgImagePath('auth')],
creator: '@ixartz',
site: '@ixartz',
},
alternates: {
canonical: url,
languages: {
en: '/en/sign-in',
fr: '/fr/sign-in',
},
},
};
}

Expand Down
41 changes: 38 additions & 3 deletions src/app/[locale]/(auth)/(center)/sign-up/[[...sign-up]]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Metadata } from 'next';
import { SignUp } from '@clerk/nextjs';
import { getTranslations, setRequestLocale } from 'next-intl/server';
import { getI18nPath } from '@/utils/Helpers';
import { generateMetadataUrl, getI18nPath, getOgImagePath, getOpenGraphLocale } from '@/utils/Helpers';

type ISignUpPageProps = {
params: Promise<{ locale: string }>;
Expand All @@ -14,9 +14,44 @@ export async function generateMetadata(props: ISignUpPageProps): Promise<Metadat
namespace: 'SignUp',
});

const title = t('meta_title');
const description = t('meta_description');
const url = generateMetadataUrl('/sign-up', locale);

return {
title: t('meta_title'),
description: t('meta_description'),
title,
description,
openGraph: {
title,
description,
url,
siteName: 'Next.js Boilerplate',
images: [
{
url: getOgImagePath('signup'),
width: 1200,
height: 630,
alt: title,
},
],
locale: getOpenGraphLocale(locale),
type: 'website',
},
twitter: {
card: 'summary_large_image',
title,
description,
images: [getOgImagePath('signup')],
creator: '@ixartz',
site: '@ixartz',
},
alternates: {
canonical: url,
languages: {
en: '/en/sign-up',
fr: '/fr/sign-up',
},
},
};
}

Expand Down
39 changes: 38 additions & 1 deletion src/app/[locale]/(auth)/dashboard/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Metadata } from 'next';
import { getTranslations } from 'next-intl/server';
import { Hello } from '@/components/Hello';
import { generateMetadataUrl, getOgImagePath, getOpenGraphLocale } from '@/utils/Helpers';

export async function generateMetadata(props: {
params: Promise<{ locale: string }>;
Expand All @@ -11,8 +12,44 @@ export async function generateMetadata(props: {
namespace: 'Dashboard',
});

const title = t('meta_title');
const description = t('meta_description');
const url = generateMetadataUrl('/dashboard', locale);

return {
title: t('meta_title'),
title,
description,
openGraph: {
title,
description,
url,
siteName: 'Next.js Boilerplate',
images: [
{
url: getOgImagePath('dashboard'),
width: 1200,
height: 630,
alt: title,
},
],
locale: getOpenGraphLocale(locale),
type: 'website',
},
twitter: {
card: 'summary_large_image',
title,
description,
images: [getOgImagePath('dashboard')],
creator: '@ixartz',
site: '@ixartz',
},
alternates: {
canonical: url,
languages: {
en: '/en/dashboard',
fr: '/fr/dashboard',
},
},
};
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Metadata } from 'next';
import { UserProfile } from '@clerk/nextjs';
import { getTranslations, setRequestLocale } from 'next-intl/server';
import { getI18nPath } from '@/utils/Helpers';
import { generateMetadataUrl, getI18nPath, getOgImagePath, getOpenGraphLocale } from '@/utils/Helpers';

type IUserProfilePageProps = {
params: Promise<{ locale: string }>;
Expand All @@ -14,8 +14,44 @@ export async function generateMetadata(props: IUserProfilePageProps): Promise<Me
namespace: 'UserProfile',
});

const title = t('meta_title');
const description = t('meta_description');
const url = generateMetadataUrl('/dashboard/user-profile', locale);

return {
title: t('meta_title'),
title,
description,
openGraph: {
title,
description,
url,
siteName: 'Next.js Boilerplate',
images: [
{
url: getOgImagePath('dashboard'),
width: 1200,
height: 630,
alt: title,
},
],
locale: getOpenGraphLocale(locale),
type: 'website',
},
twitter: {
card: 'summary_large_image',
title,
description,
images: [getOgImagePath('dashboard')],
creator: '@ixartz',
site: '@ixartz',
},
alternates: {
canonical: url,
languages: {
en: '/en/dashboard/user-profile',
fr: '/fr/dashboard/user-profile',
},
},
};
}

Expand Down
40 changes: 38 additions & 2 deletions src/app/[locale]/(marketing)/about/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Metadata } from 'next';
import { getTranslations, setRequestLocale } from 'next-intl/server';
import Image from 'next/image';
import { generateMetadataUrl, getOgImagePath, getOpenGraphLocale } from '@/utils/Helpers';

type IAboutProps = {
params: Promise<{ locale: string }>;
Expand All @@ -13,9 +14,44 @@ export async function generateMetadata(props: IAboutProps): Promise<Metadata> {
namespace: 'About',
});

const title = t('meta_title');
const description = t('meta_description');
const url = generateMetadataUrl('/about', locale);

return {
title: t('meta_title'),
description: t('meta_description'),
title,
description,
openGraph: {
title,
description,
url,
siteName: 'Next.js Boilerplate',
images: [
{
url: getOgImagePath(),
width: 1200,
height: 630,
alt: title,
},
],
locale: getOpenGraphLocale(locale),
type: 'website',
},
twitter: {
card: 'summary_large_image',
title,
description,
images: [getOgImagePath('dashboard')],
creator: '@ixartz',
site: '@ixartz',
},
alternates: {
canonical: url,
languages: {
en: '/en/about',
fr: '/fr/about',
},
},
};
}

Expand Down
40 changes: 38 additions & 2 deletions src/app/[locale]/(marketing)/counter/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Image from 'next/image';
import { Suspense } from 'react';
import { CounterForm } from '@/components/CounterForm';
import { CurrentCount } from '@/components/CurrentCount';
import { generateMetadataUrl, getOgImagePath, getOpenGraphLocale } from '@/utils/Helpers';

export async function generateMetadata(props: {
params: Promise<{ locale: string }>;
Expand All @@ -15,9 +16,44 @@ export async function generateMetadata(props: {
namespace: 'Counter',
});

const title = t('meta_title');
const description = t('meta_description');
const url = generateMetadataUrl('/counter', locale);

return {
title: t('meta_title'),
description: t('meta_description'),
title,
description,
openGraph: {
title,
description,
url,
siteName: 'Next.js Boilerplate',
images: [
{
url: getOgImagePath(),
width: 1200,
height: 630,
alt: title,
},
],
locale: getOpenGraphLocale(locale),
type: 'website',
},
twitter: {
card: 'summary_large_image',
title,
description,
images: [getOgImagePath()],
creator: '@ixartz',
site: '@ixartz',
},
alternates: {
canonical: url,
languages: {
en: '/en/counter',
fr: '/fr/counter',
},
},
};
}

Expand Down
40 changes: 38 additions & 2 deletions src/app/[locale]/(marketing)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Metadata } from 'next';
import { getTranslations, setRequestLocale } from 'next-intl/server';
import { Sponsors } from '@/components/Sponsors';
import { generateMetadataUrl, getOgImagePath, getOpenGraphLocale } from '@/utils/Helpers';

type IIndexProps = {
params: Promise<{ locale: string }>;
Expand All @@ -13,9 +14,44 @@ export async function generateMetadata(props: IIndexProps): Promise<Metadata> {
namespace: 'Index',
});

const title = t('meta_title');
const description = t('meta_description');
const url = generateMetadataUrl('/', locale);

return {
title: t('meta_title'),
description: t('meta_description'),
title,
description,
openGraph: {
title,
description,
url,
siteName: 'Next.js Boilerplate',
images: [
{
url: getOgImagePath(),
width: 1200,
height: 630,
alt: title,
},
],
locale: getOpenGraphLocale(locale),
type: 'website',
},
twitter: {
card: 'summary_large_image',
title,
description,
images: [getOgImagePath()],
creator: '@ixartz',
site: '@ixartz',
},
alternates: {
canonical: url,
languages: {
en: '/en',
fr: '/fr',
},
},
};
}

Expand Down
Loading