Skip to content

Commit

Permalink
seo tags and meta data add
Browse files Browse the repository at this point in the history
  • Loading branch information
zobkazi committed Nov 21, 2024
1 parent ea8e4d2 commit c2ef5a0
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 10 deletions.
28 changes: 28 additions & 0 deletions src/contexts/SEO.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// lib/seo.ts

import { SeoMetadata } from "@/types/seo"; // Import types

export const seoMetadata: SeoMetadata = {
title: "Radio Chilmari - Community Radio Station in Chilmari, Bangladesh",
description: "Radio Chilmari is a community radio station providing educational content, including women's rights and local news, broadcasting in the Rangpur-Dinajpur region of Bangladesh.",
keywords: "Radio Chilmari, community radio, women's rights, Bangla radio, 99.20 FM, Chilmari, Kurigram, FM radio Bangladesh, RDRS Bangladesh, Kurigram, Bangladesh, Kurigram district, Rangpur, Dinajpur",
author: "Radio Chilmari",
creator: "RDRS Bangladesh",
robots: "index, follow",
viewport: "width=device-width, initial-scale=1.0",
openGraph: {
title: "Radio Chilmari - Empowering Communities Through Radio",
description: "Radio Chilmari broadcasts local and cultural content focused on empowering women and promoting community development in Bangladesh.",
type: "website",
url: "https://www.radiochilmari.com",
image: "/public/images/og-image.jpg", // Ensure path is correct
site_name: "Radio Chilmari",
},
twitter: {
card: "summary_large_image",
site: "@RadioChilmari",
title: "Radio Chilmari - Community Radio for Social Change",
description: "Listen to Radio Chilmari for insightful content on women's rights and local news from Bangladesh's rural regions.",
image: "/public/images/twitter-card-image.jpg", // Update path accordingly
},
};
41 changes: 31 additions & 10 deletions src/layouts/RootLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
import type { Metadata } from "next";
// app/layout.tsx or _app.tsx

import { Metadata } from "next";
import { Inter } from "next/font/google";
import "@/styles/globals.css";
import Navbar from '@/components/ui/Navbar';
import Footer from "@/components/ui/Footer";
import { seoMetadata } from "@/contexts/SEO"; // Import the SEO metadata

const inter = Inter({ subsets: ["latin"] });

export const metadata: Metadata = {
title: "Welcome to the radiochilmari",
description: "radiochilmari",
title: seoMetadata.title,
description: seoMetadata.description,
keywords: seoMetadata.keywords,
creator: seoMetadata.creator,
robots: seoMetadata.robots,
openGraph: seoMetadata.openGraph,
twitter: seoMetadata.twitter,
icons: { icon: "/public/apple-touch-icon.png" },
};

Expand All @@ -19,18 +27,31 @@ export default async function RootLayout({
}>) {
return (
<html lang="en">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="radiochilmari" />
<meta name="author" content="radiochilmari" />
<meta name="keywords" content="radiochilmari kurigramfmradio, fmradio, radiochilmari, radiochilmari kurigramfmradio" key="keywords" />
<head>
<meta name="viewport" content={seoMetadata.viewport} />
<meta name="description" content={seoMetadata.description} />
<meta name="author" content={seoMetadata.author} />
<meta name="keywords" content={seoMetadata.keywords} />
<meta name="robots" content={seoMetadata.robots} />
<meta property="og:title" content={seoMetadata.openGraph.title} />
<meta property="og:description" content={seoMetadata.openGraph.description} />
<meta property="og:type" content={seoMetadata.openGraph.type} />
<meta property="og:url" content={seoMetadata.openGraph.url} />
<meta property="og:image" content={seoMetadata.openGraph.image} />
<meta property="og:site_name" content={seoMetadata.openGraph.site_name} />
<meta name="twitter:card" content={seoMetadata.twitter.card} />
<meta name="twitter:site" content={seoMetadata.twitter.site} />
<meta name="twitter:title" content={seoMetadata.twitter.title} />
<meta name="twitter:description" content={seoMetadata.twitter.description} />
<meta name="twitter:image" content={seoMetadata.twitter.image} />
</head>
<body className={inter.className}>
<Navbar />
<div className="flex-grow container mx-auto px-4 pt-20 font-bengali">
{children}
{children}
</div>
<Footer />

</body>
</html>
);
}
}
31 changes: 31 additions & 0 deletions src/types/seo.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// types/seo.d.ts

export interface OpenGraphMetadata {
title: string;
description: string;
type: string;
url: string;
image: string;
site_name: string;
}

export interface TwitterMetadata {
card: string;
site: string;
title: string;
description: string;
image: string;
}

export interface SeoMetadata {
title: string;
description: string;
keywords: string;
author: string;
creator: string;
robots: string;
viewport: string;
openGraph: OpenGraphMetadata;
twitter: TwitterMetadata;
}

0 comments on commit c2ef5a0

Please sign in to comment.