diff --git a/frontend/next.config.mjs b/frontend/next.config.mjs index 528a6a3e..fc820896 100644 --- a/frontend/next.config.mjs +++ b/frontend/next.config.mjs @@ -1,3 +1,5 @@ +import { basePath } from '@/config/siteConfig'; + /** @type {import('next').NextConfig} */ const nextConfig = { webpack: (config) => { @@ -14,12 +16,8 @@ const nextConfig = { ], }, - env: { - NEXT_PUBLIC_BUILD_TIME: `${Date.now()}`, - }, - output: "export", - basePath: "/ProxmoxVE", + basePath: basePath, }; export default nextConfig; diff --git a/frontend/src/app/sitemap.ts b/frontend/src/app/sitemap.ts index b2484727..ae7ff9c8 100644 --- a/frontend/src/app/sitemap.ts +++ b/frontend/src/app/sitemap.ts @@ -1,20 +1,20 @@ import type { MetadataRoute } from "next"; +import { headers } from "next/headers"; export const dynamic = "force-static"; -export default function sitemap(): MetadataRoute.Sitemap { +export default async function sitemap(): Promise { + const headersList = await headers(); + let domain = headersList.get("host") as string; + let protocol = "https"; return [ { - url: "https://community-scripts.github.io/Proxmox/", + url: `${protocol}://${domain}/${process.env.BASE_PATH}`, lastModified: new Date(), - changeFrequency: "yearly", - priority: 0.8, }, { - url: "https://community-scripts.github.io/Proxmox/scripts", + url: `${protocol}://${domain}/${process.env.BASE_PATH}/scripts`, lastModified: new Date(), - changeFrequency: "monthly", - priority: 1, }, ]; }