Fix SEO review feedback for JSON-LD, robots, and shared config

This commit is contained in:
Naymur Rahman
2026-03-31 16:29:43 +06:00
parent a18f5e5e2f
commit 573f9195cb
7 changed files with 78 additions and 126 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ export default function Head() {
return (
<>
<meta name="robots" content="noindex, nofollow" />
<link rel="canonical" href="https://tools.ui-layouts.com/" />
<link rel="canonical" href="https://tools.ui-layouts.com/example" />
</>
);
}
+4 -6
View File
@@ -133,13 +133,11 @@ export default function RootLayout({
gtag('config', 'G-5G7F4C09QB');
`}
</Script>
<Script
id="global-schema"
<script
type="application/ld+json"
strategy="beforeInteractive"
>
{schema()}
</Script>
// biome-ignore lint/security/noDangerouslySetInnerHtml: JSON-LD must be server-rendered as raw script content for crawlers.
dangerouslySetInnerHTML={{ __html: schema() }}
/>
<body suppressHydrationWarning className={`${poppins.className}`}>
<NuqsAdapter>
<ThemeProvider attribute="class">
+6 -28
View File
@@ -1,7 +1,6 @@
import HomeIndex from "@/components/view/home";
import { siteConfig } from "@/lib/utils";
import type { Metadata } from "next";
import Script from "next/script";
export const metadata: Metadata = {
title: "UI Tools for Designers and Developers",
@@ -13,7 +12,7 @@ export const metadata: Metadata = {
};
export default function Home() {
const websiteSchema = {
const webpageSchema = {
"@context": "https://schema.org",
"@type": "WebPage",
name: "UI Tools for Designers and Developers",
@@ -33,34 +32,13 @@ export default function Home() {
},
};
const faqSchema = {
"@context": "https://schema.org",
"@type": "FAQPage",
mainEntity: [
{
"@type": "Question",
name: "Are these UI tools free to use?",
acceptedAnswer: {
"@type": "Answer",
text: "Yes. UI Tools is free and open-source for designers and developers.",
},
},
{
"@type": "Question",
name: "Which tools are available?",
acceptedAnswer: {
"@type": "Answer",
text: "You can use Shadow Generator, SVG Clip-Path Generator, Mesh Gradient Creator, Background Snippets, Color Lab, and SVG Line Draw.",
},
},
],
};
return (
<>
<Script id="homepage-schema" type="application/ld+json">
{JSON.stringify([websiteSchema, faqSchema])}
</Script>
<script
type="application/ld+json"
// biome-ignore lint/security/noDangerouslySetInnerHtml: JSON-LD must be emitted as raw script content in server HTML.
dangerouslySetInnerHTML={{ __html: JSON.stringify(webpageSchema) }}
/>
<HomeIndex />
</>
);
+3 -4
View File
@@ -1,14 +1,13 @@
import { siteConfig } from "@/lib/utils";
import type { MetadataRoute } from "next";
export default function robots(): MetadataRoute.Robots {
const baseUrl = "https://tools.ui-layouts.com";
return {
rules: {
userAgent: "*",
allow: "/",
disallow: ["/api/", "/admin/", "/example"],
disallow: ["/api/", "/admin/"],
},
sitemap: `${baseUrl}/sitemap.xml`,
sitemap: `${siteConfig.url}/sitemap.xml`,
};
}
+15 -73
View File
@@ -1,12 +1,12 @@
export default function schema() {
const baseUrl = "https://tools.ui-layouts.com";
import { TOOL_SCHEMA_DETAILS, TOOL_SLUGS, siteConfig } from "@/lib/utils";
export default function schema() {
const organizationSchema = {
"@context": "https://schema.org",
"@type": "Organization",
name: "UI Tools",
url: baseUrl,
logo: `${baseUrl}/icon-512x512.png`,
url: siteConfig.url,
logo: `${siteConfig.url}/icon-512x512.png`,
description:
"Free collection of modern web design tools for developers and designers",
contactPoint: {
@@ -21,21 +21,16 @@ export default function schema() {
"@context": "https://schema.org",
"@type": "WebSite",
name: "UI Tools",
url: baseUrl,
url: siteConfig.url,
description:
"Free collection of modern web design tools. Generate CSS backgrounds, gradients, shadows, colors, and more.",
potentialAction: {
"@type": "SearchAction",
target: `${baseUrl}/?q={search_term_string}`,
"query-input": "required name=search_term_string",
},
};
const softwareApplicationSchema = {
"@context": "https://schema.org",
"@type": "SoftwareApplication",
name: "UI Tools",
url: baseUrl,
url: siteConfig.url,
description:
"Free collection of modern web design tools for developers and designers",
applicationCategory: "DesignApplication",
@@ -55,68 +50,15 @@ export default function schema() {
],
};
const toolsSchema = [
{
"@context": "https://schema.org",
"@type": "SoftwareApplication",
name: "Background Snippets Generator",
url: `${baseUrl}/background-snippets`,
description:
"Generate beautiful CSS background patterns, gradients, and textures for your website",
applicationCategory: "DesignApplication",
operatingSystem: "Web Browser",
},
{
"@context": "https://schema.org",
"@type": "SoftwareApplication",
name: "SVG Clip-Path Generator",
url: `${baseUrl}/clip-paths`,
description:
"Create and customize SVG clip-path shapes for modern web design",
applicationCategory: "DesignApplication",
operatingSystem: "Web Browser",
},
{
"@context": "https://schema.org",
"@type": "SoftwareApplication",
name: "Color Lab",
url: `${baseUrl}/color-lab`,
description:
"Generate color palettes, convert between formats, and create Shadcn UI themes",
applicationCategory: "DesignApplication",
operatingSystem: "Web Browser",
},
{
"@context": "https://schema.org",
"@type": "SoftwareApplication",
name: "Mesh Gradient Generator",
url: `${baseUrl}/mesh-gradients`,
description:
"Create beautiful mesh gradients and fluid color transitions for web designs",
applicationCategory: "DesignApplication",
operatingSystem: "Web Browser",
},
{
"@context": "https://schema.org",
"@type": "SoftwareApplication",
name: "CSS Shadow Generator",
url: `${baseUrl}/shadows`,
description:
"Generate beautiful CSS and Tailwind CSS box-shadows and text-shadows",
applicationCategory: "DesignApplication",
operatingSystem: "Web Browser",
},
{
"@context": "https://schema.org",
"@type": "SoftwareApplication",
name: "SVG Line Draw",
url: `${baseUrl}/svg-line-draw`,
description:
"Create hand-drawn SVG lines, arrows, and animations for web design",
applicationCategory: "DesignApplication",
operatingSystem: "Web Browser",
},
];
const toolsSchema = TOOL_SLUGS.map((slug) => ({
"@context": "https://schema.org",
"@type": "SoftwareApplication",
name: TOOL_SCHEMA_DETAILS[slug].name,
url: `${siteConfig.url}/${slug}`,
description: TOOL_SCHEMA_DETAILS[slug].description,
applicationCategory: "DesignApplication",
operatingSystem: "Web Browser",
}));
// Return as JSON-LD script content
return JSON.stringify([
+4 -14
View File
@@ -1,26 +1,16 @@
import { TOOL_SLUGS, siteConfig } from "@/lib/utils";
import type { MetadataRoute } from "next";
export default function sitemap(): MetadataRoute.Sitemap {
const baseUrl = "https://tools.ui-layouts.com";
const tools = [
"background-snippets",
"clip-paths",
"color-lab",
"mesh-gradients",
"shadows",
"svg-line-draw",
];
return [
{
url: baseUrl,
url: siteConfig.url,
lastModified: new Date(),
changeFrequency: "weekly",
priority: 1,
},
...tools.map((tool) => ({
url: `${baseUrl}/${tool}`,
...TOOL_SLUGS.map((tool) => ({
url: `${siteConfig.url}/${tool}`,
lastModified: new Date(),
changeFrequency: "monthly" as const,
priority: 0.8,
+45
View File
@@ -234,3 +234,48 @@ export const siteConfig = {
github: "https://github.com/naymurdev",
},
};
export const TOOL_SLUGS = [
"background-snippets",
"clip-paths",
"color-lab",
"mesh-gradients",
"shadows",
"svg-line-draw",
] as const;
export const TOOL_SCHEMA_DETAILS: Record<
(typeof TOOL_SLUGS)[number],
{ name: string; description: string }
> = {
"background-snippets": {
name: "Background Snippets Generator",
description:
"Generate beautiful CSS background patterns, gradients, and textures for your website",
},
"clip-paths": {
name: "SVG Clip-Path Generator",
description:
"Create and customize SVG clip-path shapes for modern web design",
},
"color-lab": {
name: "Color Lab",
description:
"Generate color palettes, convert between formats, and create Shadcn UI themes",
},
"mesh-gradients": {
name: "Mesh Gradient Generator",
description:
"Create beautiful mesh gradients and fluid color transitions for web designs",
},
shadows: {
name: "CSS Shadow Generator",
description:
"Generate beautiful CSS and Tailwind CSS box-shadows and text-shadows",
},
"svg-line-draw": {
name: "SVG Line Draw",
description:
"Create hand-drawn SVG lines, arrows, and animations for web design",
},
};