Skip to content
This repository has been archived by the owner on Jun 2, 2024. It is now read-only.

Commit

Permalink
[docs] Sitemap
Browse files Browse the repository at this point in the history
  • Loading branch information
maxijonson committed Aug 16, 2023
1 parent 06afda3 commit c5a35ab
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/docs/src/app/robots.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { MetadataRoute } from "next";
import { BASEURL } from "../config/constants";

const robots = (): MetadataRoute.Robots => {
const baseUrl = new URL(BASEURL);

return {
rules: {
userAgent: "*",
allow: "/",
},
sitemap: `${baseUrl.origin}/sitemap.xml`,
};
};

export default robots;
18 changes: 18 additions & 0 deletions packages/docs/src/app/sitemap.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { MetadataRoute } from "next";
import { BASEURL } from "../config/constants";
import { allDocs } from ".contentlayer/generated";

const sitemap = (): MetadataRoute.Sitemap => {
const baseUrl = new URL(BASEURL);

return [
{
url: baseUrl.origin,
},
...allDocs.map((doc) => ({
url: `${baseUrl.origin}/${doc.slug}`,
})),
];
};

export default sitemap;
1 change: 1 addition & 0 deletions packages/docs/src/config/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ export const SHELLASIDE_WIDTH = 260;

export const MDX_ROOT_ID = "__mdx_root__";

export const BASEURL = "https://gpt-turbo.chintristan.io/";
export const API_BASEURL = "https://maxijonson.github.io/gpt-turbo/";

0 comments on commit c5a35ab

Please sign in to comment.