From c6a00a75104160ac0f91156605003f1e94cf2c0e Mon Sep 17 00:00:00 2001 From: Bram Suurd <78373894+BramSuurdje@users.noreply.github.com> Date: Fri, 8 Nov 2024 13:56:22 +0100 Subject: [PATCH] Setup redirect to new website located at /ProxmoxVE --- src/app/layout.tsx | 124 +++++++++++++++++---------------------- src/app/scripts/page.tsx | 103 ++------------------------------ 2 files changed, 61 insertions(+), 166 deletions(-) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 68f65f7..a8c951b 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,87 +1,73 @@ -import Footer from "@/components/Footer"; -import Navbar from "@/components/Navbar"; -import { ThemeProvider } from "@/components/theme-provider"; -import { Toaster } from "@/components/ui/sonner"; +'use client' import "@/styles/globals.css"; import { Inter } from "next/font/google"; -import React from "react"; -import { NuqsAdapter } from "nuqs/adapters/next/app"; +import React, { useEffect } from "react"; const inter = Inter({ subsets: ["latin"] }); -export const metadata = { - title: "Proxmox VE Helper-Scripts", - generator: "Next.js", - applicationName: "Proxmox VE Helper-Scripts", - referrer: "origin-when-cross-origin", - keywords: [ - "Proxmox VE", - "Helper-Scripts", - "tteck", - "helper", - "scripts", - "proxmox", - "VE", - ], - authors: { name: "Bram Suurd" }, - creator: "Bram Suurd", - publisher: "Bram Suurd", - description: - "A Front-end for the Proxmox VE Helper-Scripts (Community) Repository. Featuring over 200+ scripts to help you manage your Proxmox VE environment.", - favicon: "/app/favicon.ico", - formatDetection: { - email: false, - address: false, - telephone: false, - }, - metadataBase: new URL("https://community-scripts.github.io/Proxmox/"), - openGraph: { - title: "Proxmox VE Helper-Scripts", - description: - "A Front-end for the Proxmox VE Helper-Scripts (Community) Repository. Featuring over 200+ scripts to help you manage your Proxmox VE environment.", - url: "/defaultimg.png", - images: [ - { - url: "https://community-scripts.github.io/Proxmox/defaultimg.png", - }, - ], - locale: "en_US", - type: "website", - }, -}; - +// export const metadata = { +// title: "Proxmox VE Helper-Scripts", +// generator: "Next.js", +// applicationName: "Proxmox VE Helper-Scripts", +// referrer: "origin-when-cross-origin", +// keywords: [ +// "Proxmox VE", +// "Helper-Scripts", +// "tteck", +// "helper", +// "scripts", +// "proxmox", +// "VE", +// ], +// authors: { name: "Bram Suurd" }, +// creator: "Bram Suurd", +// publisher: "Bram Suurd", +// description: +// "A Front-end for the Proxmox VE Helper-Scripts (Community) Repository. Featuring over 200+ scripts to help you manage your Proxmox VE environment.", +// favicon: "/app/favicon.ico", +// formatDetection: { +// email: false, +// address: false, +// telephone: false, +// }, +// metadataBase: new URL("https://community-scripts.github.io/Proxmox/"), +// openGraph: { +// title: "Proxmox VE Helper-Scripts", +// description: +// "A Front-end for the Proxmox VE Helper-Scripts (Community) Repository. Featuring over 200+ scripts to help you manage your Proxmox VE environment.", +// url: "/defaultimg.png", +// images: [ +// { +// url: "https://community-scripts.github.io/Proxmox/defaultimg.png", +// }, +// ], export default function RootLayout({ children, }: Readonly<{ children: React.ReactNode; }>) { + useEffect(() => { + const originalUrl = window.location.pathname; + const newBaseUrl = "https://community-scripts.github.io/ProxmoxVE"; + + const newUrl = originalUrl.replace(/^\/Proxmox/, newBaseUrl) || "/"; + + if (newUrl !== window.location.href) { + window.location.href = newUrl; + } + }, []); + return (
- - - - ++ If you are not redirected automatically, follow this{" "} + link to example. +
+ {children} ); diff --git a/src/app/scripts/page.tsx b/src/app/scripts/page.tsx index 4a56b62..7072957 100644 --- a/src/app/scripts/page.tsx +++ b/src/app/scripts/page.tsx @@ -1,100 +1,9 @@ -"use client"; - -export const dynamic = "force-static"; - -import ScriptItem from "@/app/scripts/_components/ScriptItem"; -import { Category, Script } from "@/lib/types"; -import { Loader2 } from "lucide-react"; -import { Suspense, useEffect, useState } from "react"; -import Sidebar from "./_components/Sidebar"; -import { useQueryState } from "nuqs"; -import { - LatestScripts, - MostViewedScripts, -} from "./_components/ScriptInfoBlocks"; - -function ScriptContent() { - const [selectedScript, setSelectedScript] = useQueryState("id"); - const [links, setLinks] = useState