Skip to content

Commit

Permalink
Improve the SEO :Implement XML sitemap
Browse files Browse the repository at this point in the history
Create a robots.txt file &Create a sitemap generator
  • Loading branch information
Stan370 committed Nov 3, 2024
1 parent 6697d56 commit af0411e
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 22 deletions.
26 changes: 26 additions & 0 deletions app/components/JsonLd.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
export default function JsonLd() {
return (
<script
type="application/ld+json"
dangerouslySetInnerHTML={{
__html: JSON.stringify({
"@context": "https://schema.org",
"@type": "WebApplication",
"name": "TonyChat",
"description": "Open-source multifunctional chatbot platform",
"applicationCategory": "BusinessApplication",
"operatingSystem": "All",
"offers": {
"@type": "Offer",
"price": "0",
"priceCurrency": "USD"
},
"author": {
"@type": "Organization",
"name": "TonyChat"
}
})
}}
/>
)
}
16 changes: 10 additions & 6 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
import type { Metadata } from 'next'
import { Inter } from 'next/font/google'
import './globals.css'
import Head from 'next/head'
import { Metadata } from 'next'
import defaultMetadata from './metadata'

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

export const metadata: Metadata = defaultMetadata


export const metadata: Metadata = {
title: 'TonyChat APP',
description: 'Offer Open-Source customized Agents The Future of Self-Running AI',
}

export default function RootLayout({
children,
}: {
Expand All @@ -31,6 +28,13 @@ export default function RootLayout({
media="(prefers-color-scheme: light)"
/>
<link rel="icon" href="/favicon.ico?v=1" />
<link
rel="preload"
href="/fonts/your-main-font.woff2"
as="font"
type="font/woff2"
crossOrigin="anonymous"
/>
</Head>

<body className={inter.className}>{children}</body>
Expand Down
38 changes: 38 additions & 0 deletions app/metadata.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { Metadata } from 'next'

const defaultMetadata: Metadata = {
title: {
default: 'TonyChat - Your Personal and Business Chatbot',
template: '%s | TonyChat'
},
description: 'TonyChat is an open-source, multifunctional Chatbot suitable for both personal and business purposes. It allows for customized chatbot deployment, easy model fine-tuning, and ensures safety and privacy.',
keywords: ['chatbot', 'AI', 'business chat', 'personal assistant', 'open source'],
authors: [{ name: 'TonyChat' }],
creator: 'TonyChat',
publisher: 'TonyChat',
robots: 'index, follow',
openGraph: {
type: 'website',
locale: 'en_US',
url: 'https://www.tonychat.com',
siteName: 'TonyChat',
title: 'TonyChat - Your Personal and Business Chatbot',
description: 'Open-source multifunctional chatbot platform for personal and business use',
images: [
{
url: '/T_icon.png',
width: 1200,
height: 630,
alt: 'TonyChat Logo'
}
]
},
twitter: {
card: 'summary_large_image',
title: 'TonyChat - Your Personal and Business Chatbot',
description: 'Open-source multifunctional chatbot platform for personal and business use',
images: ['/T_icon.png']
}
}

export default defaultMetadata
17 changes: 1 addition & 16 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,12 @@
import Head from "next/head";
import Carousel from "./components/Carousel";
import Sidebar from "./components/Siderbar";


export default function Home() {
const slides = ["/1.jpg", "/user.jpg", "/3.jpg"];

return (
<div className="relative min-h-screen flex flex-row bg-gray-50 dark:bg-[#17171a] dark:text-red-50">
<Head>
<title>TonyChat - Your Personal and Business Chatbot</title>
<meta
name="description"
content="TonyChat is an open-source, multifunctional Chatbot suitable for both personal and business purposes. It allows for customized chatbot deployment, easy model fine-tuning, and ensures safety and privacy."
/>
<meta
property="og:title"
content="TonyChat - Your Personal and Business Chatbot"
/>
<meta property="og:type" content="website" />
<meta property="og:image" content="/T_icon.png" />
<meta property="og:url" content="https://www.tonychat.com" />
<link rel="icon" href="/favicon.ico" />
</Head>
<Sidebar />

<div>
Expand Down
12 changes: 12 additions & 0 deletions app/robots.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { MetadataRoute } from 'next'

export default function robots(): MetadataRoute.Robots {
return {
rules: {
userAgent: '*',
allow: '/',
disallow: '/private/',
},
sitemap: 'https://www.tonychat.com/sitemap.xml',
}
}
19 changes: 19 additions & 0 deletions app/sitemap.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { MetadataRoute } from 'next'

export default function sitemap(): MetadataRoute.Sitemap {
return [
{
url: 'https://www.tonychat.com',
lastModified: new Date(),
changeFrequency: 'yearly',
priority: 1,
},
{
url: 'https://www.tonychat.com/chat',
lastModified: new Date(),
changeFrequency: 'monthly',
priority: 0.8,
},
// Add more URLs as needed
]
}

0 comments on commit af0411e

Please sign in to comment.