-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eaeddc4
commit 71106d6
Showing
9 changed files
with
158 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,43 @@ | ||
import { Inter } from "next/font/google"; | ||
import localFont from "next/font/local"; | ||
import { cookies } from "next/headers"; | ||
import Script from "next/script"; | ||
import { cn } from "~/lib/utils"; | ||
import "./globals.css"; | ||
|
||
const fontSans = Inter({ | ||
subsets: ["latin"], | ||
variable: "--font-sans", | ||
}); | ||
|
||
const fontHeading = localFont({ | ||
src: "../assets/fonts/CalSans-SemiBold.woff2", | ||
variable: "--font-heading", | ||
}); | ||
|
||
export default function RootLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return children; | ||
const locale = cookies().get("Next-Locale")?.value || "en"; | ||
return ( | ||
<html lang={locale}> | ||
<body | ||
className={cn( | ||
"font-sans antialiased", | ||
fontSans.variable, | ||
fontHeading.variable | ||
)} | ||
> | ||
{children} | ||
</body> | ||
{process.env.NODE_ENV === "production" && ( | ||
<Script | ||
src="https://umami.moinulmoin.com/script.js" | ||
data-website-id="bc66d96a-fc75-4ecd-b0ef-fdd25de8113c" | ||
/> | ||
)} | ||
</html> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,35 @@ | ||
import { type MetadataRoute } from "next"; | ||
import { siteConfig } from "~/config/site"; | ||
|
||
const locales = ["en", "fr"]; | ||
|
||
export default function sitemap(): MetadataRoute.Sitemap { | ||
return [ | ||
{ | ||
url: siteConfig.url, | ||
lastModified: new Date(), | ||
changeFrequency: "weekly", | ||
priority: 1, | ||
}, | ||
{ | ||
url: `${siteConfig.url}/about`, | ||
lastModified: new Date(), | ||
changeFrequency: "weekly", | ||
priority: 0.5, | ||
}, | ||
{ | ||
url: `${siteConfig.url}/changelog`, | ||
lastModified: new Date(), | ||
changeFrequency: "weekly", | ||
priority: 0.5, | ||
}, | ||
]; | ||
return locales | ||
.map((locale) => [ | ||
{ | ||
url: siteConfig(locale).url, | ||
lastModified: new Date(), | ||
changeFrequency: "weekly", | ||
priority: 1, | ||
}, | ||
{ | ||
url: `${siteConfig(locale).url}/login`, | ||
lastModified: new Date(), | ||
changeFrequency: "weekly", | ||
priority: 0.5, | ||
}, | ||
{ | ||
url: `${siteConfig(locale).url}/about`, | ||
lastModified: new Date(), | ||
changeFrequency: "weekly", | ||
priority: 0.5, | ||
}, | ||
{ | ||
url: `${siteConfig(locale).url}/changelog`, | ||
lastModified: new Date(), | ||
changeFrequency: "weekly", | ||
priority: 0.5, | ||
}, | ||
]) | ||
.flat() as MetadataRoute.Sitemap; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
const siteUrl = | ||
export const siteUrl = | ||
process.env.NEXT_PUBLIC_APP_URL || "https://chadnext.moinulmoin.com"; | ||
|
||
export const siteConfig = { | ||
export const siteConfig = (locale?: string) => ({ | ||
name: "ChadNext", | ||
url: siteUrl, | ||
ogImage: `${siteUrl}/opengraph-image`, | ||
description: "Quick Starter Template for your Next.js project.", | ||
url: siteUrl + "/" + locale, | ||
ogImage: `${siteUrl}/${locale}/opengraph-image`, | ||
description: "Quick Starter Template for your Next project.", | ||
links: { | ||
twitter: "https://twitter.com/immoinulmoin", | ||
github: "https://github.com/moinulmoin/chadnext", | ||
}, | ||
}; | ||
}); | ||
|
||
export type SiteConfig = typeof siteConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import { createI18nServer } from "next-international/server"; | ||
|
||
export const { getI18n, getScopedI18n, getStaticParams } = createI18nServer({ | ||
en: () => import("./en"), | ||
fr: () => import("./fr"), | ||
}); | ||
export const { getI18n, getScopedI18n, getStaticParams, getCurrentLocale } = | ||
createI18nServer({ | ||
en: () => import("./en"), | ||
fr: () => import("./fr"), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71106d6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
chadnext – ./
chadnext.vercel.app
chadnext-git-main-moinulmoin.vercel.app
chadnext-moinulmoin.vercel.app
chadnext.moinulmoin.com