1
0
mirror of https://github.com/XFox111/my-website.git synced 2026-04-22 07:28:01 +03:00

fix: robots.txt and sitemap.xml using env on build time only

This commit is contained in:
2024-10-22 22:35:05 +00:00
parent d0d4a4b677
commit 5a4b67d83e
2 changed files with 5 additions and 1 deletions
+3 -1
View File
@@ -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,
+2
View File
@@ -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,