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:
+3
-1
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user