mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-01-25 18:16:17 +00:00
Fixing Front end issues related to image loading and SEO (#219)
* Update mariadb.json * Update vaultwarden.json * Update vaultwarden.json * Update keycloak.json * Update json/keycloak.json Co-authored-by: Håvard Gjøby Thom <34199185+havardthom@users.noreply.github.com> * Update mariadb.json Co-authored-by: Håvard Gjøby Thom <34199185+havardthom@users.noreply.github.com> * Add canonical link to layout for improved SEO and page indexing * Fix image source fallback for script logos to use a consistent relative path * Fix image source for script logos across components to consistently use the "/ProxmoxVE/logo.png" path * Update image source for script logos to use basePath for consistent paths across all components * Fix image source for script logos to ensure leading slash is consistent for all components' paths --------- Co-authored-by: CanbiZ <47820557+MickLesk@users.noreply.github.com> Co-authored-by: Håvard Gjøby Thom <34199185+havardthom@users.noreply.github.com>
This commit is contained in:
parent
c162f518e5
commit
dac521c6a3
@ -64,6 +64,7 @@ export default function RootLayout({
|
|||||||
src={`https://${analytics.url}/script.js`}
|
src={`https://${analytics.url}/script.js`}
|
||||||
data-website-id={analytics.token}
|
data-website-id={analytics.token}
|
||||||
></script>
|
></script>
|
||||||
|
<link rel="canonical" href={metadata.metadataBase.href} />
|
||||||
<link rel="manifest" href="manifest.webmanifest" />
|
<link rel="manifest" href="manifest.webmanifest" />
|
||||||
<link rel="preconnect" href="https://api.github.com" />
|
<link rel="preconnect" href="https://api.github.com" />
|
||||||
</head>
|
</head>
|
||||||
|
@ -12,6 +12,7 @@ import { cn } from "@/lib/utils";
|
|||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
import { basePath } from "@/config/siteConfig";
|
||||||
|
|
||||||
export default function ScriptAccordion({
|
export default function ScriptAccordion({
|
||||||
items,
|
items,
|
||||||
@ -104,13 +105,13 @@ export default function ScriptAccordion({
|
|||||||
>
|
>
|
||||||
<div className="flex items-center">
|
<div className="flex items-center">
|
||||||
<Image
|
<Image
|
||||||
src={script.logo || "/logo.png"}
|
src={script.logo || `/${basePath}/logo.png`}
|
||||||
height={16}
|
height={16}
|
||||||
width={16}
|
width={16}
|
||||||
unoptimized
|
unoptimized
|
||||||
onError={(e) =>
|
onError={(e) =>
|
||||||
((e.currentTarget as HTMLImageElement).src =
|
((e.currentTarget as HTMLImageElement).src =
|
||||||
"/logo.png")
|
`/${basePath}/logo.png`)
|
||||||
}
|
}
|
||||||
alt={script.name}
|
alt={script.name}
|
||||||
className="mr-1 w-4 h-4 rounded-full"
|
className="mr-1 w-4 h-4 rounded-full"
|
||||||
|
@ -7,7 +7,7 @@ import {
|
|||||||
CardHeader,
|
CardHeader,
|
||||||
CardTitle,
|
CardTitle,
|
||||||
} from "@/components/ui/card";
|
} from "@/components/ui/card";
|
||||||
import { mostPopularScripts } from "@/config/siteConfig";
|
import { basePath, mostPopularScripts } from "@/config/siteConfig";
|
||||||
import { extractDate } from "@/lib/time";
|
import { extractDate } from "@/lib/time";
|
||||||
import { Category, Script } from "@/lib/types";
|
import { Category, Script } from "@/lib/types";
|
||||||
import { CalendarPlus } from "lucide-react";
|
import { CalendarPlus } from "lucide-react";
|
||||||
@ -92,11 +92,15 @@ export function LatestScripts({ items }: { items: Category[] }) {
|
|||||||
<CardTitle className="flex items-center gap-3">
|
<CardTitle className="flex items-center gap-3">
|
||||||
<div className="flex h-16 w-16 items-center justify-center rounded-lg bg-accent p-1">
|
<div className="flex h-16 w-16 items-center justify-center rounded-lg bg-accent p-1">
|
||||||
<Image
|
<Image
|
||||||
src={script.logo || "/logo.png"}
|
src={script.logo || `/${basePath}/logo.png`}
|
||||||
unoptimized
|
unoptimized
|
||||||
height={64}
|
height={64}
|
||||||
width={64}
|
width={64}
|
||||||
alt=""
|
alt=""
|
||||||
|
onError={(e) =>
|
||||||
|
((e.currentTarget as HTMLImageElement).src =
|
||||||
|
`/${basePath}/logo.png`)
|
||||||
|
}
|
||||||
className="h-11 w-11 object-contain"
|
className="h-11 w-11 object-contain"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@ -161,10 +165,14 @@ export function MostViewedScripts({ items }: { items: Category[] }) {
|
|||||||
<div className="flex max-h-16 min-h-16 min-w-16 max-w-16 items-center justify-center rounded-lg bg-accent p-1">
|
<div className="flex max-h-16 min-h-16 min-w-16 max-w-16 items-center justify-center rounded-lg bg-accent p-1">
|
||||||
<Image
|
<Image
|
||||||
unoptimized
|
unoptimized
|
||||||
src={script.logo || "/logo.png"}
|
src={script.logo || `/${basePath}/logo.png`}
|
||||||
height={64}
|
height={64}
|
||||||
width={64}
|
width={64}
|
||||||
alt=""
|
alt=""
|
||||||
|
onError={(e) =>
|
||||||
|
((e.currentTarget as HTMLImageElement).src =
|
||||||
|
`/${basePath}/logo.png`)
|
||||||
|
}
|
||||||
className="h-11 w-11 object-contain"
|
className="h-11 w-11 object-contain"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -14,6 +14,7 @@ import Description from "./ScriptItems/Description";
|
|||||||
import InstallCommand from "./ScriptItems/InstallCommand";
|
import InstallCommand from "./ScriptItems/InstallCommand";
|
||||||
import InterFaces from "./ScriptItems/InterFaces";
|
import InterFaces from "./ScriptItems/InterFaces";
|
||||||
import Tooltips from "./ScriptItems/Tooltips";
|
import Tooltips from "./ScriptItems/Tooltips";
|
||||||
|
import { basePath } from "@/config/siteConfig";
|
||||||
|
|
||||||
function ScriptItem({
|
function ScriptItem({
|
||||||
item,
|
item,
|
||||||
@ -40,10 +41,11 @@ function ScriptItem({
|
|||||||
<div className="flex">
|
<div className="flex">
|
||||||
<Image
|
<Image
|
||||||
className="h-32 w-32 rounded-lg bg-accent/60 object-contain p-3 shadow-md"
|
className="h-32 w-32 rounded-lg bg-accent/60 object-contain p-3 shadow-md"
|
||||||
src={item.logo || "/logo.png"}
|
src={item.logo || `/${basePath}/logo.png`}
|
||||||
width={400}
|
width={400}
|
||||||
onError={(e) =>
|
onError={(e) =>
|
||||||
((e.currentTarget as HTMLImageElement).src = "/logo.png")
|
((e.currentTarget as HTMLImageElement).src =
|
||||||
|
`/${basePath}/logo.png`)
|
||||||
}
|
}
|
||||||
height={400}
|
height={400}
|
||||||
alt={item.name}
|
alt={item.name}
|
||||||
|
@ -15,6 +15,7 @@ import React from "react";
|
|||||||
import { Badge } from "./ui/badge";
|
import { Badge } from "./ui/badge";
|
||||||
import { Button } from "./ui/button";
|
import { Button } from "./ui/button";
|
||||||
import { DialogTitle } from "./ui/dialog";
|
import { DialogTitle } from "./ui/dialog";
|
||||||
|
import { basePath } from "@/config/siteConfig";
|
||||||
|
|
||||||
export const formattedBadge = (type: string) => {
|
export const formattedBadge = (type: string) => {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
@ -102,10 +103,10 @@ export default function CommandMenu() {
|
|||||||
>
|
>
|
||||||
<div className="flex gap-2" onClick={() => setOpen(false)}>
|
<div className="flex gap-2" onClick={() => setOpen(false)}>
|
||||||
<Image
|
<Image
|
||||||
src={script.logo || "/logo.png"}
|
src={script.logo || `/${basePath}/logo.png`}
|
||||||
onError={(e) =>
|
onError={(e) =>
|
||||||
((e.currentTarget as HTMLImageElement).src =
|
((e.currentTarget as HTMLImageElement).src =
|
||||||
"/logo.png")
|
`/${basePath}/logo.png`)
|
||||||
}
|
}
|
||||||
unoptimized
|
unoptimized
|
||||||
width={16}
|
width={16}
|
||||||
|
Loading…
Reference in New Issue
Block a user