mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-12 02:39:17 +00:00
Refactor Next.js config to use dynamic basePath and update sitemap URLs for improved adaptability and host configuration
This commit is contained in:
parent
4bfd0e1d86
commit
860186e4fa
@ -1,3 +1,5 @@
|
|||||||
|
import { basePath } from '@/config/siteConfig';
|
||||||
|
|
||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
webpack: (config) => {
|
webpack: (config) => {
|
||||||
@ -14,12 +16,8 @@ const nextConfig = {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
env: {
|
|
||||||
NEXT_PUBLIC_BUILD_TIME: `${Date.now()}`,
|
|
||||||
},
|
|
||||||
|
|
||||||
output: "export",
|
output: "export",
|
||||||
basePath: "/ProxmoxVE",
|
basePath: basePath,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default nextConfig;
|
export default nextConfig;
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
import type { MetadataRoute } from "next";
|
import type { MetadataRoute } from "next";
|
||||||
|
import { headers } from "next/headers";
|
||||||
|
|
||||||
export const dynamic = "force-static";
|
export const dynamic = "force-static";
|
||||||
|
|
||||||
export default function sitemap(): MetadataRoute.Sitemap {
|
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
||||||
|
const headersList = await headers();
|
||||||
|
let domain = headersList.get("host") as string;
|
||||||
|
let protocol = "https";
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
url: "https://community-scripts.github.io/Proxmox/",
|
url: `${protocol}://${domain}/${process.env.BASE_PATH}`,
|
||||||
lastModified: new Date(),
|
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(),
|
lastModified: new Date(),
|
||||||
changeFrequency: "monthly",
|
|
||||||
priority: 1,
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user