feat(web): Optimize SEO (#1260)

This commit is contained in:
Thomas Camlong
2025-04-24 18:22:15 +02:00
committed by GitHub
parent 038e4dc73d
commit 57b0e6a1aa
4 changed files with 933 additions and 67 deletions

View File

@@ -44,11 +44,13 @@ export async function generateMetadata({ params, searchParams }: Props, parent:
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.`,
assets: [iconImageUrl],
category: "icons",
keywords: [
`${formattedIconName} icon`,
"dashboard icon",
"service icon",
`${formattedIconName} icon download`,
`${formattedIconName} icon svg`,
`${formattedIconName} icon png`,
`${formattedIconName} icon webp`,
`${icon} icon`,
"application icon",
"tool icon",
"web dashboard",
@@ -58,10 +60,6 @@ export async function generateMetadata({ params, searchParams }: Props, parent:
icon: iconImageUrl,
},
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.`,
robots: {
index: true,
follow: true,
},
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.`,

View File

@@ -7,7 +7,7 @@ import type { Metadata, Viewport } from "next"
import { Inter } from "next/font/google"
import { Toaster } from "sonner"
import "./globals.css"
import { getDescription, websiteTitle } from "@/constants"
import { BASE_URL, getDescription, WEB_URL, websiteTitle } from "@/constants"
import { ThemeProvider } from "./theme-provider"
const inter = Inter({
@@ -29,44 +29,41 @@ export async function generateMetadata(): Promise<Metadata> {
const { totalIcons } = await getTotalIcons()
return {
metadataBase: new URL("https://dashboardicons.com"),
metadataBase: new URL(WEB_URL),
title: websiteTitle,
description: getDescription(totalIcons),
keywords: ["dashboard icons", "service icons", "application icons", "tool icons", "web dashboard", "app directory"],
robots: {
index: true,
follow: true,
"max-image-preview": "large",
"max-snippet": -1,
"max-video-preview": -1,
googleBot: "index, follow",
},
openGraph: {
siteName: "Dashboard Icons",
type: "website",
locale: "en_US",
siteName: WEB_URL,
title: websiteTitle,
url: BASE_URL,
description: getDescription(totalIcons),
url: "https://dashboardicons.com",
images: [
{
url: "/og-image.png",
width: 1200,
height: 630,
alt: "Dashboard Icons",
alt: "Dashboard Icons - Dashboard icons for self hosted services",
type: "image/png",
},
],
},
twitter: {
card: "summary_large_image",
site: "@homarr_app",
creator: "@homarr_app",
title: websiteTitle,
title: WEB_URL,
description: getDescription(totalIcons),
images: ["/og-image.png"],
},
applicationName: "Dashboard Icons",
applicationName: WEB_URL,
alternates: {
canonical: BASE_URL,
},
appleWebApp: {
title: "Dashboard Icons",
statusBarStyle: "default",
@@ -79,13 +76,6 @@ export async function generateMetadata(): Promise<Metadata> {
{ url: "/favicon-32x32.png", sizes: "32x32", type: "image/png" },
],
apple: [{ url: "/apple-touch-icon.png", sizes: "180x180", type: "image/png" }],
other: [
{
rel: "mask-icon",
url: "/safari-pinned-tab.svg",
color: "#000000",
},
],
},
manifest: "/site.webmanifest",
}

View File

@@ -1,45 +1,7 @@
import { HeroSection } from "@/components/hero"
import { RecentlyAddedIcons } from "@/components/recently-added-icons"
import { BASE_URL, REPO_NAME, getDescription, websiteTitle } from "@/constants"
import { REPO_NAME } from "@/constants"
import { getRecentlyAddedIcons, getTotalIcons } from "@/lib/api"
import type { Metadata } from "next"
export async function generateMetadata(): Promise<Metadata> {
const { totalIcons } = await getTotalIcons()
return {
title: websiteTitle,
description: getDescription(totalIcons),
keywords: ["dashboard icons", "service icons", "application icons", "tool icons", "web dashboard", "app directory"],
robots: {
index: true,
follow: true,
},
openGraph: {
title: websiteTitle,
description: getDescription(totalIcons),
type: "website",
url: BASE_URL,
images: [
{
url: "/og-image.png",
width: 1200,
height: 630,
alt: "Dashboard Icons",
},
],
},
twitter: {
title: websiteTitle,
description: getDescription(totalIcons),
card: "summary_large_image",
images: ["/og-image.png"],
},
alternates: {
canonical: BASE_URL,
},
}
}
async function getGitHubStars() {
const response = await fetch(`https://api.github.com/repos/${REPO_NAME}`)