From 659384a6d4e847f88c147c393e9a78608d00d2d5 Mon Sep 17 00:00:00 2001 From: Thomas Camlong Date: Mon, 19 May 2025 15:13:16 +0200 Subject: [PATCH] chore: update package manager and enhance icon metadata - Updated package manager version to pnpm@10.11.0 in package.json. - Added robots metadata for SEO in page.tsx. - Changed Open Graph type from "article" to "website" and added siteName and images. - Included canonical URL in alternates for better indexing. - Added structured data for icons in the IconDetails component with priority loading for images. --- web/package.json | 2 +- web/src/app/icons/[icon]/page.tsx | 53 ++++++++++++++++++++++++----- web/src/components/icon-details.tsx | 2 ++ 3 files changed, 47 insertions(+), 10 deletions(-) diff --git a/web/package.json b/web/package.json index 0c33be2d..12bfdc8f 100644 --- a/web/package.json +++ b/web/package.json @@ -77,7 +77,7 @@ "typescript": "^5.8.3", "wrangler": "^4.12.0" }, - "packageManager": "pnpm@10.8.0", + "packageManager": "pnpm@10.11.0", "pnpm": { "onlyBuiltDependencies": [ "@biomejs/biome", diff --git a/web/src/app/icons/[icon]/page.tsx b/web/src/app/icons/[icon]/page.tsx index bd0c064c..2f6e75b2 100644 --- a/web/src/app/icons/[icon]/page.tsx +++ b/web/src/app/icons/[icon]/page.tsx @@ -1,9 +1,7 @@ import { IconDetails } from "@/components/icon-details" import { BASE_URL, WEB_URL } from "@/constants" import { getAllIcons, getAuthorData } from "@/lib/api" -import { formatIconName } from "@/lib/utils" import type { Metadata, ResolvingMetadata } from "next" -import { default as dynamicImport } from "next/dynamic" import { notFound } from "next/navigation" export const dynamicParams = false @@ -67,17 +65,32 @@ export async function generateMetadata({ params, searchParams }: Props, parent: icons: { icon: `${BASE_URL}/webp/${icon}.webp`, }, + robots: { + index: true, + follow: true, + nocache: false, + googleBot: { + index: true, + follow: true, + noimageindex: false, + "max-video-preview": -1, + "max-image-preview": "large", + }, + }, abstract: `Download the ${formattedIconName} icon in SVG, PNG, and WEBP formats for FREE. Part of a collection of ${totalIcons} curated icons for services, applications and tools, designed specifically for dashboards and app directories.`, openGraph: { title: `${formattedIconName} Icon | Dashboard Icons`, description: `Download the ${formattedIconName} icon in SVG, PNG, and WEBP formats for FREE. Part of a collection of ${totalIcons} curated icons for services, applications and tools, designed specifically for dashboards and app directories.`, - type: "article", + type: "website", url: pageUrl, - authors: [authorName], - publishedTime: updateDate.toISOString(), - modifiedTime: updateDate.toISOString(), - section: "Icons", - tags: [formattedIconName, "dashboard icon", "service icon", "application icon", "tool icon", "web dashboard", "app directory"], + siteName: "Dashboard Icons", + images: [{ + url: `${BASE_URL}/webp/${icon}.webp`, + width: 512, + height: 512, + alt: `${formattedIconName} icon`, + }] + }, twitter: { card: "summary_large_image", @@ -85,6 +98,7 @@ export async function generateMetadata({ params, searchParams }: Props, parent: description: `Download the ${formattedIconName} icon in SVG, PNG, and WEBP formats for FREE. Part of a collection of ${totalIcons} curated icons for services, applications and tools, designed specifically for dashboards and app directories.`, }, alternates: { + canonical: `${WEB_URL}/icons/${icon}`, media: { png: `${BASE_URL}/png/${icon}.png`, svg: `${BASE_URL}/svg/${icon}.svg`, @@ -105,5 +119,26 @@ export default async function IconPage({ params }: { params: Promise<{ icon: str const authorData = await getAuthorData(originalIconData.update.author.id) - return + return ( + <> +