Skip to content

Commit

Permalink
Merge pull request rahulsainlll#36 from myselfshivams/main
Browse files Browse the repository at this point in the history
added:: Meta Tags, Robots.txt, and Sitemap for Improved SEO
  • Loading branch information
rahulsainlll authored Oct 4, 2024
2 parents 46226c6 + 487c1f5 commit b51109b
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 3 deletions.
34 changes: 33 additions & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,45 @@ import { Footer } from "@/components/ui/footer";

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

// fallback to the production URL
const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || "https://git-trace.vercel.app/";

export const metadata: Metadata = {
title: {
default: "Git-Trace",
template: "%s | Git-Trace"
template: "%s | Git-Trace",
},
description:
"Instantly search, view, and bookmark GitHub repositories and issues. Streamline your workflow and keep your favorite projects at your fingertips!",
openGraph: {
title: "Git-Trace",
description:
"Instantly search, view, and bookmark GitHub repositories and issues. Streamline your workflow and keep your favorite projects at your fingertips!",
type: "website",
url: baseUrl,
images: [
{
url: `${baseUrl}/git3.png`,
width: 800,
height: 600,
alt: "Git-Trace OG Image",
},
],
},
twitter: {
card: "summary_large_image",
title: "Git-Trace",
description:
"Instantly search, view, and bookmark GitHub repositories and issues.",
images: `${baseUrl}/git3.png`,
},
keywords: [
"GitHub repositories",
"GitHub issues",
"repository search",
"workflow tools",
"developer tools",
],
};

export default function RootLayout({
Expand Down
9 changes: 9 additions & 0 deletions next-sitemap.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || 'https://git-trace.vercel.app/';

module.exports = {
siteUrl: baseUrl,
generateRobotsTxt: true,
changefreq: 'daily',
priority: 0.7,
sitemapSize: 5000,
};
38 changes: 37 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"dev": "next dev",
"build": "prisma generate && next build",
"start": "next start",
"lint": "next lint"
"lint": "next lint",
"sitemap": "next-sitemap",
"postbuild": "next-sitemap"
},
"prisma": {
"seed": "ts-node --compiler-options {\"module\":\"CommonJS\"} prisma/seed.ts"
Expand All @@ -32,6 +34,7 @@
"lucide-react": "^0.427.0",
"next": "14.2.5",
"next-auth": "^4.24.7",
"next-sitemap": "^4.2.3",
"nodemailer": "^6.9.14",
"prisma": "^5.18.0",
"react": "^18",
Expand Down
9 changes: 9 additions & 0 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# *
User-agent: *
Allow: /

# Host
Host: https://git-trace.vercel.app/

# Sitemaps
Sitemap: https://git-trace.vercel.app/sitemap.xml
7 changes: 7 additions & 0 deletions public/sitemap-0.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
<url><loc>https://git-trace.vercel.app/auth/signin</loc><lastmod>2024-10-04T04:08:27.800Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://git-trace.vercel.app/auth/signup</loc><lastmod>2024-10-04T04:08:27.805Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://git-trace.vercel.app/blog</loc><lastmod>2024-10-04T04:08:27.805Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://git-trace.vercel.app</loc><lastmod>2024-10-04T04:08:27.805Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
</urlset>
4 changes: 4 additions & 0 deletions public/sitemap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap><loc>https://git-trace.vercel.app/sitemap-0.xml</loc></sitemap>
</sitemapindex>

0 comments on commit b51109b

Please sign in to comment.