diff --git a/web/biome.json b/web/biome.json index 6738ae2b..fb933380 100644 --- a/web/biome.json +++ b/web/biome.json @@ -22,6 +22,9 @@ "recommended": true, "suspicious": { "noArrayIndexKey": "off" + }, + "security": { + "noDangerouslySetInnerHtml": "off" } } }, diff --git a/web/src/app/icons/[icon]/opengraph-image.tsx b/web/src/app/icons/[icon]/opengraph-image.tsx index 82d62c5f..9fcc98ad 100644 --- a/web/src/app/icons/[icon]/opengraph-image.tsx +++ b/web/src/app/icons/[icon]/opengraph-image.tsx @@ -1,13 +1,8 @@ import { readFile } from "node:fs/promises" import { join } from "node:path" +import { SITE_NAME, SITE_TAGLINE, WEB_URL, getIconDescription } from "@/constants" import { getAllIcons } from "@/lib/api" import { ImageResponse } from "next/og" -import { - SITE_NAME, - SITE_TAGLINE, - getIconDescription, - WEB_URL -} from "@/constants" export const dynamic = "force-static" diff --git a/web/src/app/icons/[icon]/page.tsx b/web/src/app/icons/[icon]/page.tsx index ce3a50bd..51e379c9 100644 --- a/web/src/app/icons/[icon]/page.tsx +++ b/web/src/app/icons/[icon]/page.tsx @@ -1,10 +1,20 @@ import { IconDetails } from "@/components/icon-details" import { StructuredData } from "@/components/structured-data" -import { BASE_URL, GITHUB_URL, ICON_DETAIL_KEYWORDS, SITE_NAME, SITE_TAGLINE, TITLE_SEPARATOR, WEB_URL, getIconDescription, getIconSchema } from "@/constants" +import { + BASE_URL, + GITHUB_URL, + ICON_DETAIL_KEYWORDS, + SITE_NAME, + SITE_TAGLINE, + TITLE_SEPARATOR, + WEB_URL, + getIconDescription, + getIconSchema, +} from "@/constants" import { getAllIcons, getAuthorData } from "@/lib/api" import type { Metadata, ResolvingMetadata } from "next" -import Script from "next/script" import { notFound } from "next/navigation" +import Script from "next/script" export const dynamicParams = false @@ -109,7 +119,7 @@ export default async function IconPage({ params }: { params: { icon: string } }) authorName, authorData.html_url, updateDate.toISOString(), - Object.keys(iconsData).length + Object.keys(iconsData).length, ) return ( diff --git a/web/src/app/icons/page.tsx b/web/src/app/icons/page.tsx index 1aa7d5f5..4421a990 100644 --- a/web/src/app/icons/page.tsx +++ b/web/src/app/icons/page.tsx @@ -1,7 +1,19 @@ -import { BASE_URL, BROWSE_KEYWORDS, DEFAULT_OG_IMAGE, GITHUB_URL, ORGANIZATION_NAME, ORGANIZATION_SCHEMA, SITE_NAME, SITE_TAGLINE, TITLE_SEPARATOR, WEB_URL, getBrowseDescription } from "@/constants" +import { StructuredData } from "@/components/structured-data" +import { + BASE_URL, + BROWSE_KEYWORDS, + DEFAULT_OG_IMAGE, + GITHUB_URL, + ORGANIZATION_NAME, + ORGANIZATION_SCHEMA, + SITE_NAME, + SITE_TAGLINE, + TITLE_SEPARATOR, + WEB_URL, + getBrowseDescription, +} from "@/constants" import { getIconsArray } from "@/lib/api" import type { Metadata } from "next" -import { StructuredData } from "@/components/structured-data" import { IconSearch } from "./components/icon-search" export async function generateMetadata(): Promise { @@ -42,15 +54,15 @@ export default async function IconsPage() { const gallerySchema = { "@context": "https://schema.org", "@type": "ImageGallery", - "name": `${SITE_NAME} - Browse ${icons.length} Icons - ${SITE_TAGLINE}`, - "description": getBrowseDescription(icons.length), - "url": `${WEB_URL}/icons`, - "numberOfItems": icons.length, - "creator": { + name: `${SITE_NAME} - Browse ${icons.length} Icons - ${SITE_TAGLINE}`, + description: getBrowseDescription(icons.length), + url: `${WEB_URL}/icons`, + numberOfItems: icons.length, + creator: { "@type": "Organization", - "name": ORGANIZATION_NAME, - "url": GITHUB_URL - } + name: ORGANIZATION_NAME, + url: GITHUB_URL, + }, } return ( @@ -62,7 +74,9 @@ export default async function IconsPage() {

Icons

-

Search our collection of {icons.length} icons - {SITE_TAGLINE}.

+

+ Search our collection of {icons.length} icons - {SITE_TAGLINE}. +

diff --git a/web/src/app/layout.tsx b/web/src/app/layout.tsx index f5e3dd96..22d33b4d 100644 --- a/web/src/app/layout.tsx +++ b/web/src/app/layout.tsx @@ -8,7 +8,20 @@ import type { Metadata, Viewport } from "next" import { Inter } from "next/font/google" import { Toaster } from "sonner" import "./globals.css" -import { DEFAULT_KEYWORDS, DEFAULT_OG_IMAGE, GITHUB_URL, ORGANIZATION_NAME, ORGANIZATION_SCHEMA, SITE_NAME, SITE_TAGLINE, WEB_URL, getDescription, getWebsiteSchema, websiteFullTitle, websiteTitle } from "@/constants" +import { + DEFAULT_KEYWORDS, + DEFAULT_OG_IMAGE, + GITHUB_URL, + ORGANIZATION_NAME, + ORGANIZATION_SCHEMA, + SITE_NAME, + SITE_TAGLINE, + WEB_URL, + getDescription, + getWebsiteSchema, + websiteFullTitle, + websiteTitle, +} from "@/constants" import { ThemeProvider } from "./theme-provider" const inter = Inter({ @@ -102,10 +115,7 @@ export default async function RootLayout({ children }: Readonly<{ children: Reac - +
{children}
diff --git a/web/src/app/page.tsx b/web/src/app/page.tsx index 70f008e1..e3247612 100644 --- a/web/src/app/page.tsx +++ b/web/src/app/page.tsx @@ -1,6 +1,20 @@ import { HeroSection } from "@/components/hero" import { RecentlyAddedIcons } from "@/components/recently-added-icons" -import { BASE_URL, DEFAULT_KEYWORDS, DEFAULT_OG_IMAGE, GITHUB_URL, ORGANIZATION_NAME, ORGANIZATION_SCHEMA, SITE_NAME, SITE_TAGLINE, WEB_URL, REPO_NAME, getHomeDescription, websiteFullTitle, websiteTitle } from "@/constants" +import { + BASE_URL, + DEFAULT_KEYWORDS, + DEFAULT_OG_IMAGE, + GITHUB_URL, + ORGANIZATION_NAME, + ORGANIZATION_SCHEMA, + REPO_NAME, + SITE_NAME, + SITE_TAGLINE, + WEB_URL, + getHomeDescription, + websiteFullTitle, + websiteTitle, +} from "@/constants" import { getRecentlyAddedIcons, getTotalIcons } from "@/lib/api" import type { Metadata } from "next" diff --git a/web/src/components/structured-data.tsx b/web/src/components/structured-data.tsx index dc1593eb..020d0302 100644 --- a/web/src/components/structured-data.tsx +++ b/web/src/components/structured-data.tsx @@ -1,31 +1,22 @@ type StructuredDataProps = { - data: any - id?: string + data: Record + id?: string } export const StructuredData = ({ data, id }: StructuredDataProps) => { - return ( -