Skip to content

Commit

Permalink
update SEO
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedriad1 committed Feb 25, 2024
1 parent 86a55f9 commit 55f0098
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 97 deletions.
Binary file added public/cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/favicon.ico
Binary file not shown.
7 changes: 3 additions & 4 deletions src/app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ import "@/styles/globals.css";
import Providers from "./providers";
import { useMessages } from "next-intl";
import { getFontsClassnames } from "@/lib/fonts";
import { getMetadata, getViewport } from "@/lib/seo";

export const metadata = {
title: "The Platform",
icons: [{ rel: "icon", url: "/favicon.ico" }],
};
export const metadata = getMetadata();
export const viewport = getViewport();

export default function LocaleLayout({
children,
Expand Down
93 changes: 0 additions & 93 deletions src/fonts/amiri/OFL.txt

This file was deleted.

75 changes: 75 additions & 0 deletions src/lib/seo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import { type Metadata, type Viewport } from "next";

export const config = {
title: "Library | Seemore",
shortTitle: "Seemore",
siteName: "Seemore Library",
description: "Access thousands of Islamic texts in seconds.",
themeColor: "#AA4A44",
locale: "en_US",
image: {
url: "/cover.png",
width: 1500,
height: 600,
alt: "Seemore Library Cover",
},
url: "https://library.digitalseem.org",
};

export const getMetadata = ({
title: baseTitle,
description = config.description,
}: {
title?: string;
description?: string;
} = {}): Metadata => {
const images = [config.image];
const title = baseTitle
? `${baseTitle} | ${config.shortTitle}`
: config.title;

return {
title,
description,
metadataBase: new URL(config.url),
icons: [{ rel: "icon", url: "/favicon.ico" }],
openGraph: {
type: "website",
siteName: config.siteName,
locale: config.locale,
url: "/",
title,
description,
images,
},
alternates: {
canonical: "/",
},
robots: {
index: true,
follow: true,
googleBot: {
index: true,
follow: true,
"max-video-preview": -1,
"max-image-preview": "large",
"max-snippet": -1,
},
},
twitter: {
card: "summary_large_image",
title,
description,
images,
},
};
};

export const getViewport = (): Viewport => {
return {
width: "device-width",
initialScale: 1,
viewportFit: "cover",
themeColor: config.themeColor,
};
};

0 comments on commit 55f0098

Please sign in to comment.