Skip to content

Commit

Permalink
fix: 🐛 robots.ts, sitemap.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
moinulmoin committed Jun 21, 2024
1 parent b85631b commit 3dedf21
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 48 deletions.
15 changes: 0 additions & 15 deletions src/app/[locale]/robots.ts

This file was deleted.

33 changes: 0 additions & 33 deletions src/app/[locale]/sitemap.ts

This file was deleted.

15 changes: 15 additions & 0 deletions src/app/robots.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { type MetadataRoute } from "next";
import { siteUrl } from "~/config/site";

export default function robots(): MetadataRoute.Robots {
return {
rules: [
{
userAgent: "*",
allow: "/",
disallow: ["/api/", `/dashboard`],
},
],
sitemap: `${siteUrl}/sitemap.xml`,
};
}
55 changes: 55 additions & 0 deletions src/app/sitemap.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { type MetadataRoute } from "next";
import { siteUrl } from "~/config/site";

export default function sitemap(): MetadataRoute.Sitemap {
return [
{
url: siteUrl,
lastModified: new Date(),
changeFrequency: "weekly",
priority: 1,
alternates: {
languages: {
en: `${siteUrl}/en`,
fr: `${siteUrl}/fr`,
},
},
},
{
url: `${siteUrl}/login`,
lastModified: new Date(),
changeFrequency: "weekly",
priority: 0.5,
alternates: {
languages: {
en: `${siteUrl}/en/login`,
fr: `${siteUrl}/fr/login`,
},
},
},
{
url: `${siteUrl}/about`,
lastModified: new Date(),
changeFrequency: "weekly",
priority: 0.5,
alternates: {
languages: {
en: `${siteUrl}/en/about`,
fr: `${siteUrl}/fr/about`,
},
},
},
{
url: `${siteUrl}/changelog`,
lastModified: new Date(),
changeFrequency: "weekly",
priority: 0.5,
alternates: {
languages: {
en: `${siteUrl}/en/changelog`,
fr: `${siteUrl}/fr/changelog`,
},
},
},
];
}

0 comments on commit 3dedf21

Please sign in to comment.