Skip to content

Commit

Permalink
fix: robots.txt and sitemap.xml using env on build time only
Browse files Browse the repository at this point in the history
  • Loading branch information
XFox111 committed Oct 22, 2024
1 parent d0d4a4b commit 5a4b67d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/robots.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { MetadataRoute } from "next";
import { unstable_noStore } from "next/cache";
import { canonicalName } from "./_data/metadata";

export default function robots(): MetadataRoute.Robots
{
unstable_noStore();
return {
rules: {
userAgent: "*",
allow: [ "/$", "/resume" ],
allow: [ "/$", "/resume", "/sitemap.xml" ],
disallow: [ "/resume/download", "/" ],
},
sitemap: new URL("/sitemap.xml", canonicalName.href).href,
Expand Down
2 changes: 2 additions & 0 deletions app/sitemap.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { MetadataRoute } from "next";
import { unstable_noStore } from "next/cache";
import { canonicalName } from "./_data/metadata";

export default function sitemap(): MetadataRoute.Sitemap
{
unstable_noStore();
return [
{
url: canonicalName.href,
Expand Down

0 comments on commit 5a4b67d

Please sign in to comment.