Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added GitaGPT #223

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
9 changes: 6 additions & 3 deletions src/app/[[...locale]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand All @@ -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: {
Expand Down Expand Up @@ -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,
},
Expand Down
7 changes: 5 additions & 2 deletions src/app/about/[[...locale]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand All @@ -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: {
Expand Down
7 changes: 5 additions & 2 deletions src/app/acknowledgements/[[...locale]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand All @@ -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: {
Expand Down
7 changes: 5 additions & 2 deletions src/app/bhagavad-gita-quotes/[[...locale]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
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,
},
Expand All @@ -57,7 +57,9 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
},
{
Expand All @@ -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",
},
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand All @@ -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: {
Expand Down
22 changes: 22 additions & 0 deletions src/app/gitagpt/[[...locale]]/constants.ts
Original file line number Diff line number Diff line change
@@ -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",
},
},
],
};
34 changes: 34 additions & 0 deletions src/app/gitagpt/[[...locale]]/layout.tsx
Original file line number Diff line number Diff line change
@@ -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<LayoutProps> = ({ params, children }) => {
const [translations, setTranslations] = useState<Record<string, string>>({});
const locale = paramsToLocale(params);

useEffect(() => {
const loadTranslations = async () => {
const loadedTranslations = await getTranslations(locale);
setTranslations(loadedTranslations);
};

loadTranslations();
}, [locale]);

return (
<ChatbotLayout locale={locale} translations={translations}>
{children}
</ChatbotLayout>
);
};

export default GitaGPTLayout;
66 changes: 66 additions & 0 deletions src/app/gitagpt/[[...locale]]/page.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(vedvyasJsonLD) }}
/>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(pageJsonLd) }}
/>
{["en", "hi"].includes(locale) && (
<iframe
style={{
height: "calc(100vh - 90px)",
width: "100vw",
border: "none",
}}
src="https://widget.writesonic.com/CDN/index.html?service-base-url=https://api.botsonic.ai&token=aa05c2d3-8669-4d3f-9637-1967c13d6233&base-origin=https://bot.writesonic.com&instance-name=Botsonic&standalone=true"
></iframe>
)}
;
</>
);
}
8 changes: 5 additions & 3 deletions src/app/verse-of-the-day/[[...locale]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ export async function generateMetadata(): Promise<Metadata> {
title: `Bhagavad Gita - Verse of the Day`,
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,
},
Expand All @@ -33,7 +33,9 @@ export async function generateMetadata(): Promise<Metadata> {
twitter: {
card: "summary_large_image",
title: `Bhagavad Gita - Verse of the Day`,
images: ["https://bhagavadgita.io/static/images/sribhagavadgita.jpg"],
images: [
"https://bhagavadgita.io/_next/image?url=%2Fbanner2.png&w=3840&q=75",
],
site: "@ShriKrishna",
},
alternates: {
Expand Down
7 changes: 7 additions & 0 deletions src/components/Headers/IndexHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ const chapters = [
const mobileNav = [
{ name: "Quotes", href: "/bhagavad-gita-quotes", current: false },
{ name: "About Gita", href: "/about", current: false },
{ name: "Gita AI", href: "/gitagpt", current: false },
];

type Props = {
Expand Down Expand Up @@ -236,6 +237,12 @@ export default function IndexHeader({ locale, translate }: Props) {
>
{translate("About Gita")}
</LinkWithLocale>
<LinkWithLocale
href="/gitagpt"
className="text-base font-medium text-black hover:text-gray-500 focus:outline-none dark:text-white"
>
{translate("Gita AI")}
</LinkWithLocale>
{/* {!loggedIn ? (
<Popover className="relative">
{({ open }) => (
Expand Down
15 changes: 15 additions & 0 deletions src/constant/vedvyasJsonLD.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export const vedvyasJsonLD = {
"@context": "http://schema.org",
"@type": "Organization",
"@id": "#organization",
name: "Ved Vyas Foundation",
url: "https://vedvyas.org",
sameAs: [
"https://www.facebook.com/iiRadhaKrishnaii/",
"https://www.linkedin.com/company/bhagavadgita/",
"https://www.pinterest.com/iiradhakrishnaii/",
"https://twitter.com/ShriKrishna",
"https://github.com/gita",
],
logo: "https://bhagavadgita.io/favicon/android-chrome-512x512.png",
};
23 changes: 23 additions & 0 deletions src/layouts/ChatbotLayout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"use client";

import { getTranslate } from "shared/translate";

import Footer from "../components/Footers/Footer";
import IndexHeader from "../components/Headers/IndexHeader";

const ChatbotLayout = ({
children,
locale,
translations,
}: React.PropsWithChildren<LocaleAndTranslations>) => {
const translate = getTranslate(translations, locale);

return (
<div className="flex min-h-screen flex-col dark:bg-dark-bg">
<IndexHeader locale={locale} translate={translate} />
<div className="flex-1 pt-[84px] lg:pt-[90px]">{children}</div>
</div>
);
};

export default ChatbotLayout;
3 changes: 2 additions & 1 deletion src/shared/translate/locales/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,6 @@
"Sorry, we couldn't find the page you're looking for": "क्षमा करें, हम वह पेज नहीं ढूंढ सके जिसे आप ढूंढ रहे थे",
"App": "मोबाइल ऐप",
"Privacy": "प्राइवेसी",
"Acknowledgements": "स्वीकृतियाँ"
"Acknowledgements": "स्वीकृतियाँ",
"Gita AI": "गीता एआई"
}
Loading
Loading