From 0fb0cc9496085f7482d6bccfada179ebf044ae53 Mon Sep 17 00:00:00 2001 From: samanyougarg Date: Sun, 24 Sep 2023 01:24:04 +0530 Subject: [PATCH] added GitaGPT --- package.json | 2 +- src/app/[[...locale]]/page.tsx | 9 +- src/app/about/[[...locale]]/page.tsx | 7 +- .../acknowledgements/[[...locale]]/page.tsx | 7 +- .../[[...locale]]/page.tsx | 7 +- .../(chapter)/[[...locale]]/functions.ts | 3 +- .../(chapter)/[[...locale]]/page.tsx | 8 +- .../[verseNumber]/[[...locale]]/functions.ts | 6 +- .../[verseNumber]/[[...locale]]/page.tsx | 8 +- src/app/gitagpt/[[...locale]]/constants.ts | 22 ++ src/app/gitagpt/[[...locale]]/layout.tsx | 34 +++ src/app/gitagpt/[[...locale]]/page.tsx | 66 +++++ .../verse-of-the-day/[[...locale]]/page.tsx | 8 +- src/components/Headers/IndexHeader.tsx | 7 + src/constant/vedvyasJsonLD.ts | 15 + src/layouts/ChatbotLayout.tsx | 23 ++ src/shared/translate/locales/hi.json | 3 +- yarn.lock | 279 +++++++++--------- 18 files changed, 357 insertions(+), 157 deletions(-) create mode 100644 src/app/gitagpt/[[...locale]]/constants.ts create mode 100644 src/app/gitagpt/[[...locale]]/layout.tsx create mode 100644 src/app/gitagpt/[[...locale]]/page.tsx create mode 100644 src/constant/vedvyasJsonLD.ts create mode 100644 src/layouts/ChatbotLayout.tsx diff --git a/package.json b/package.json index fb8c7a7..629676b 100755 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "@headlessui/react": "^1.4.1", "@heroicons/react": "v1", "@popperjs/core": "2.9.1", - "@sentry/nextjs": "^7.67.0", + "@sentry/nextjs": "^7.70.0", "@supabase/supabase-js": "^2.0.4", "@svgr/cli": "^6.1.1", "@types/express": "^4.17.17", diff --git a/src/app/[[...locale]]/page.tsx b/src/app/[[...locale]]/page.tsx index 4303703..9c253bd 100644 --- a/src/app/[[...locale]]/page.tsx +++ b/src/app/[[...locale]]/page.tsx @@ -15,7 +15,8 @@ export const metadata: Metadata = { "Bhagwat Geeta in Hindi and English. Read Bhagavad Gita online in a simple, beautiful and easy-to-use interface; Gita Saar In Hindi; Bhagavad Gita quotes.", url: "https://bhagavadgita.io", siteName: "Bhagavad Gita", - images: "https://bhagavadgita.io/static/images/sribhagavadgita.jpg", + images: + "https://bhagavadgita.io/_next/image?url=%2Fbanner2.png&w=3840&q=75", locale: "en_US", type: "website", }, @@ -24,7 +25,9 @@ export const metadata: Metadata = { title: "Srimad Bhagavad Gita - Free Searchable Online Bhagwat Geeta", description: "Bhagwat Geeta in Hindi and English. Read Bhagavad Gita online in a simple, beautiful and easy-to-use interface; Gita Saar In Hindi; Bhagavad Gita quotes.", - images: ["https://bhagavadgita.io/static/images/sribhagavadgita.jpg"], + images: [ + "https://bhagavadgita.io/_next/image?url=%2Fbanner2.png&w=3840&q=75", + ], site: "@ShriKrishna", }, verification: { @@ -80,7 +83,7 @@ export default async function Home({ params }: ParamsWithLocale) { }, image: { "@type": "ImageObject", - url: "https://bhagavadgita.io/static/images/sribhagavadgita.jpg", + url: "https://bhagavadgita.io/_next/image?url=%2Fbanner2.png&w=3840&q=75", width: 1553, height: 660, }, diff --git a/src/app/about/[[...locale]]/page.tsx b/src/app/about/[[...locale]]/page.tsx index 2642abf..4aa0d8c 100644 --- a/src/app/about/[[...locale]]/page.tsx +++ b/src/app/about/[[...locale]]/page.tsx @@ -16,7 +16,8 @@ export const metadata: Metadata = { "Bhagavad Gita, also known as the Gita - the song of lord is a practical guide to one's life that guides one re-organise their life, achieve inner peace and approach supreme lord (the ultimate reality).", url: "https://bhagavadgita.io/about", siteName: "Bhagavad Gita", - images: "https://bhagavadgita.io/static/images/sribhagavadgita.jpg", + images: + "https://bhagavadgita.io/_next/image?url=%2Fbanner2.png&w=3840&q=75", locale: "en_US", type: "website", }, @@ -25,7 +26,9 @@ export const metadata: Metadata = { title: "What is The Bhagavad Gita - BhagavadGita.io", description: "Bhagavad Gita, also known as the Gita - the song of lord is a practical guide to one's life that guides one re-organise their life, achieve inner peace and approach supreme lord (the ultimate reality).", - images: ["https://bhagavadgita.io/static/images/sribhagavadgita.jpg"], + images: [ + "https://bhagavadgita.io/_next/image?url=%2Fbanner2.png&w=3840&q=75", + ], site: "@ShriKrishna", }, alternates: { diff --git a/src/app/acknowledgements/[[...locale]]/page.tsx b/src/app/acknowledgements/[[...locale]]/page.tsx index 6248a20..2b920a5 100644 --- a/src/app/acknowledgements/[[...locale]]/page.tsx +++ b/src/app/acknowledgements/[[...locale]]/page.tsx @@ -16,7 +16,8 @@ export const metadata: Metadata = { "We extend our heartfelt gratitude to esteemed organizations and individuals for allowing us to feature their invaluable Bhagavad Gita translations and commentaries.", url: "https://bhagavadgita.io/acknowledgements", siteName: "Bhagavad Gita", - images: "https://bhagavadgita.io/static/images/sribhagavadgita.jpg", + images: + "https://bhagavadgita.io/_next/image?url=%2Fbanner2.png&w=3840&q=75", locale: "en_US", type: "website", }, @@ -25,7 +26,9 @@ export const metadata: Metadata = { title: "Acknowledgements - Featured Bhagavad Gita Translations", description: "We extend our heartfelt gratitude to esteemed organizations and individuals for allowing us to feature their invaluable Bhagavad Gita translations and commentaries.", - images: ["https://bhagavadgita.io/static/images/sribhagavadgita.jpg"], + images: [ + "https://bhagavadgita.io/_next/image?url=%2Fbanner2.png&w=3840&q=75", + ], site: "@ShriKrishna", }, alternates: { diff --git a/src/app/bhagavad-gita-quotes/[[...locale]]/page.tsx b/src/app/bhagavad-gita-quotes/[[...locale]]/page.tsx index d2feb53..3869c47 100644 --- a/src/app/bhagavad-gita-quotes/[[...locale]]/page.tsx +++ b/src/app/bhagavad-gita-quotes/[[...locale]]/page.tsx @@ -16,14 +16,17 @@ export const metadata: Metadata = { "100+ Bhagavad Gita Quotes spoken by Lord Krishna in the Bhagavad Gita to Arjuna on the battlefield of the Kurukshetra.", url: "https://bhagavadgita.io/bhagavad-gita-quotes", siteName: "Bhagavad Gita", - images: "https://bhagavadgita.io/static/images/sribhagavadgita.jpg", + images: + "https://bhagavadgita.io/_next/image?url=%2Fbanner2.png&w=3840&q=75", locale: "en_US", type: "website", }, twitter: { card: "summary_large_image", title: "Bhagavad Gita Quotes By Krishna - BhagavadGita.io", - images: ["https://bhagavadgita.io/static/images/sribhagavadgita.jpg"], + images: [ + "https://bhagavadgita.io/_next/image?url=%2Fbanner2.png&w=3840&q=75", + ], site: "@ShriKrishna", }, alternates: { diff --git a/src/app/chapter/[chapterNumber]/(chapter)/[[...locale]]/functions.ts b/src/app/chapter/[chapterNumber]/(chapter)/[[...locale]]/functions.ts index fcfb26b..09b5324 100644 --- a/src/app/chapter/[chapterNumber]/(chapter)/[[...locale]]/functions.ts +++ b/src/app/chapter/[chapterNumber]/(chapter)/[[...locale]]/functions.ts @@ -16,7 +16,8 @@ export const getJsonLd = (chapterNumber: string, nameTranslated?: string) => ({ item: { "@id": `https://bhagavadgita.io/chapter/${chapterNumber}`, name: `Bhagavad Gita Chapter ${chapterNumber} - ${nameTranslated}`, - image: "https://bhagavadgita.io/static/images/sribhagavadgita.jpg", + image: + "https://bhagavadgita.io/_next/image?url=%2Fbanner2.png&w=3840&q=75", }, }, ], diff --git a/src/app/chapter/[chapterNumber]/(chapter)/[[...locale]]/page.tsx b/src/app/chapter/[chapterNumber]/(chapter)/[[...locale]]/page.tsx index b7031ce..178100a 100644 --- a/src/app/chapter/[chapterNumber]/(chapter)/[[...locale]]/page.tsx +++ b/src/app/chapter/[chapterNumber]/(chapter)/[[...locale]]/page.tsx @@ -45,9 +45,9 @@ export async function generateMetadata({ params }: Props): Promise { description: `${chapterDescription}...`, images: [ { - url: "https://bhagavadgita.io/static/images/sribhagavadgita.jpg", + url: "https://bhagavadgita.io/_next/image?url=%2Fbanner2.png&w=3840&q=75", secureUrl: - "https://bhagavadgita.io/static/images/sribhagavadgita.jpg", + "https://bhagavadgita.io/_next/image?url=%2Fbanner2.png&w=3840&q=75", height: 1080, width: 1920, }, @@ -57,7 +57,9 @@ export async function generateMetadata({ params }: Props): Promise { card: "summary_large_image", title: `Bhagavad Gita Chapter ${chapterNumber} - ${chapterData.gita_chapters_by_pk.name_translated} - BhagavadGita.io`, description: `${chapterDescription}...`, - images: ["https://bhagavadgita.io/static/images/sribhagavadgita.jpg"], + images: [ + "https://bhagavadgita.io/_next/image?url=%2Fbanner2.png&w=3840&q=75", + ], site: "@ShriKrishna", }, alternates: { diff --git a/src/app/chapter/[chapterNumber]/verse/[verseNumber]/[[...locale]]/functions.ts b/src/app/chapter/[chapterNumber]/verse/[verseNumber]/[[...locale]]/functions.ts index c1434d2..6f48489 100644 --- a/src/app/chapter/[chapterNumber]/verse/[verseNumber]/[[...locale]]/functions.ts +++ b/src/app/chapter/[chapterNumber]/verse/[verseNumber]/[[...locale]]/functions.ts @@ -16,7 +16,8 @@ export const getJsonLd = (chapterNumber: string, verseNumber: string) => ({ item: { "@id": `https://bhagavadgita.io/chapter/${chapterNumber}?page=1`, name: `Bhagavad Gita Chapter ${chapterNumber}`, - image: "https://bhagavadgita.io/static/images/sribhagavadgita.jpg", + image: + "https://bhagavadgita.io/_next/image?url=%2Fbanner2.png&w=3840&q=75", }, }, { @@ -25,7 +26,8 @@ export const getJsonLd = (chapterNumber: string, verseNumber: string) => ({ item: { "@id": `https://bhagavadgita.io/chapter/${chapterNumber}/verse/${verseNumber}`, name: `Bhagavad Gita Chapter ${chapterNumber} Verse ${verseNumber}`, - image: "https://bhagavadgita.io/static/images/sribhagavadgita.jpg", + image: + "https://bhagavadgita.io/_next/image?url=%2Fbanner2.png&w=3840&q=75", }, }, ], diff --git a/src/app/chapter/[chapterNumber]/verse/[verseNumber]/[[...locale]]/page.tsx b/src/app/chapter/[chapterNumber]/verse/[verseNumber]/[[...locale]]/page.tsx index a586437..cf8cbe6 100644 --- a/src/app/chapter/[chapterNumber]/verse/[verseNumber]/[[...locale]]/page.tsx +++ b/src/app/chapter/[chapterNumber]/verse/[verseNumber]/[[...locale]]/page.tsx @@ -35,9 +35,9 @@ export async function generateMetadata({ title: `Bhagavad Gita Chapter ${chapterNumber} Verse ${verseNumber} - BhagavadGita.io`, images: [ { - url: "https://bhagavadgita.io/static/images/sribhagavadgita.jpg", + url: "https://bhagavadgita.io/_next/image?url=%2Fbanner2.png&w=3840&q=75", secureUrl: - "https://bhagavadgita.io/static/images/sribhagavadgita.jpg", + "https://bhagavadgita.io/_next/image?url=%2Fbanner2.png&w=3840&q=75", height: 1080, width: 1920, }, @@ -46,7 +46,9 @@ export async function generateMetadata({ twitter: { card: "summary_large_image", title: `Bhagavad Gita Chapter ${chapterNumber} Verse ${verseNumber} - BhagavadGita.io`, - images: ["https://bhagavadgita.io/static/images/sribhagavadgita.jpg"], + images: [ + "https://bhagavadgita.io/_next/image?url=%2Fbanner2.png&w=3840&q=75", + ], site: "@ShriKrishna", }, alternates: { diff --git a/src/app/gitagpt/[[...locale]]/constants.ts b/src/app/gitagpt/[[...locale]]/constants.ts new file mode 100644 index 0000000..10e6dd8 --- /dev/null +++ b/src/app/gitagpt/[[...locale]]/constants.ts @@ -0,0 +1,22 @@ +export const pageJsonLd = { + "@context": "http://schema.org", + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + item: { + "@id": "https://bhagavadgita.io", + name: "Home", + }, + }, + { + "@type": "ListItem", + position: 2, + item: { + "@id": "https://bhagavadgita.io/gitagpt", + name: "Gita GPT - AI chatbot trained on Bhagavad Gita", + }, + }, + ], +}; diff --git a/src/app/gitagpt/[[...locale]]/layout.tsx b/src/app/gitagpt/[[...locale]]/layout.tsx new file mode 100644 index 0000000..358a776 --- /dev/null +++ b/src/app/gitagpt/[[...locale]]/layout.tsx @@ -0,0 +1,34 @@ +"use client"; + +import React, { useEffect, useState } from "react"; + +import ChatbotLayout from "layouts/ChatbotLayout"; +import { paramsToLocale } from "shared/functions"; +import { getTranslations } from "shared/translate/server"; + +interface LayoutProps { + params: any; + children: React.ReactNode; +} + +const GitaGPTLayout: React.FC = ({ params, children }) => { + const [translations, setTranslations] = useState>({}); + const locale = paramsToLocale(params); + + useEffect(() => { + const loadTranslations = async () => { + const loadedTranslations = await getTranslations(locale); + setTranslations(loadedTranslations); + }; + + loadTranslations(); + }, [locale]); + + return ( + + {children} + + ); +}; + +export default GitaGPTLayout; diff --git a/src/app/gitagpt/[[...locale]]/page.tsx b/src/app/gitagpt/[[...locale]]/page.tsx new file mode 100644 index 0000000..7836cc9 --- /dev/null +++ b/src/app/gitagpt/[[...locale]]/page.tsx @@ -0,0 +1,66 @@ +import React from "react"; +import { Metadata } from "next"; + +import { paramsToLocale } from "shared/functions"; + +import { vedvyasJsonLD } from "../../../constant/vedvyasJsonLD"; +import { pageJsonLd } from "./constants"; + +export const metadata: Metadata = { + title: "Gita GPT - AI chatbot trained on Bhagavad Gita", + description: + "GitaGPT is a 100% Free AI chatbot that uses the teachings of the Bhagavad Gita to answer your everyday questions. It’s easy to use and filled with wisdom, all thanks to ChatGPT.", + openGraph: { + title: "Gita GPT - AI chatbot trained on Bhagavad Gita", + description: + "GitaGPT is a 100% Free AI chatbot that uses the teachings of the Bhagavad Gita to answer your everyday questions. It’s easy to use and filled with wisdom, all thanks to ChatGPT.", + url: "https://bhagavadgita.io/gita-gpt", + images: + "https://bhagavadgita.io/_next/image?url=%2Fbanner2.png&w=3840&q=75", + siteName: "Bhagavad Gita", + locale: "en_US", + type: "website", + }, + twitter: { + card: "summary_large_image", + title: "Gita GPT - AI chatbot trained on Bhagavad Gita", + description: + "GitaGPT is a 100% Free AI chatbot that uses the teachings of the Bhagavad Gita to answer your everyday questions. It’s easy to use and filled with wisdom, all thanks to ChatGPT.", + site: "@ShriKrishna", + images: [ + "https://bhagavadgita.io/_next/image?url=%2Fbanner2.png&w=3840&q=75", + ], + }, + alternates: { + canonical: "https://bhagavadgita.io/gita-gpt", + }, +}; + +export default async function GitaGPT(props: ParamsWithLocale) { + const { params } = props; + const locale = paramsToLocale(params); + + return ( + <> +