Skip to content

Commit 304e859

Browse files
committed
Enhance schema.org markup in layout with SearchAction and mainEntity for better SEO. Update description and add alternate names for improved clarity. Modify ClientSearch to synchronize search query with URL parameters for better user experience.
1 parent 9b0f0f3 commit 304e859

File tree

2 files changed

+85
-7
lines changed

2 files changed

+85
-7
lines changed

app/layout.tsx

Lines changed: 74 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,85 @@ export default function RootLayout({
1919
return (
2020
<html lang="en">
2121
<head>
22-
{/* Schema.org разметка для Website */}
22+
{/* Schema.org разметка для Website с SearchAction и основными разделами */}
2323
<script
2424
type="application/ld+json"
2525
dangerouslySetInnerHTML={{
2626
__html: JSON.stringify({
2727
"@context": "https://schema.org",
2828
"@type": "WebSite",
2929
name: "NXRIG",
30+
alternateName: "NX Rig",
3031
description:
31-
"Free guitar presets for NUX Mighty Plug Pro and NUX Mighty Space - fully compatible with both devices",
32+
"Free guitar presets for NUX Mighty Plug Pro and NUX Mighty Space - fully compatible with both devices. Download professional guitar tones inspired by Metallica, Nirvana, Red Hot Chili Peppers, and more legendary artists.",
3233
url: "https://nxrig.com",
34+
potentialAction: {
35+
"@type": "SearchAction",
36+
target: {
37+
"@type": "EntryPoint",
38+
urlTemplate: "https://nxrig.com/?q={search_term_string}",
39+
},
40+
"query-input": "required name=search_term_string",
41+
},
42+
mainEntity: {
43+
"@type": "ItemList",
44+
itemListElement: [
45+
{
46+
"@type": "ListItem",
47+
position: 1,
48+
item: {
49+
"@type": "WebPage",
50+
name: "All Presets",
51+
url: "https://nxrig.com/preset",
52+
},
53+
},
54+
{
55+
"@type": "ListItem",
56+
position: 2,
57+
item: {
58+
"@type": "WebPage",
59+
name: "Metallica Presets",
60+
url: "https://nxrig.com/preset/metallica",
61+
},
62+
},
63+
{
64+
"@type": "ListItem",
65+
position: 3,
66+
item: {
67+
"@type": "WebPage",
68+
name: "Nirvana Presets",
69+
url: "https://nxrig.com/preset/nirvana",
70+
},
71+
},
72+
{
73+
"@type": "ListItem",
74+
position: 4,
75+
item: {
76+
"@type": "WebPage",
77+
name: "Red Hot Chili Peppers Presets",
78+
url: "https://nxrig.com/preset/red-hot-chili-peppers",
79+
},
80+
},
81+
{
82+
"@type": "ListItem",
83+
position: 5,
84+
item: {
85+
"@type": "WebPage",
86+
name: "Led Zeppelin Presets",
87+
url: "https://nxrig.com/preset/led-zeppelin",
88+
},
89+
},
90+
{
91+
"@type": "ListItem",
92+
position: 6,
93+
item: {
94+
"@type": "WebPage",
95+
name: "Request Patch",
96+
url: "https://nxrig.com/order",
97+
},
98+
},
99+
],
100+
},
33101
}),
34102
}}
35103
/>
@@ -42,11 +110,12 @@ export default function RootLayout({
42110
"@context": "https://schema.org",
43111
"@type": "Organization",
44112
name: "NXRIG",
113+
alternateName: "NX Rig",
45114
url: "https://nxrig.com",
46115
logo: "https://nxrig.com/images/og-image.svg",
47-
sameAs: [
48-
// Можно добавить ссылки на социальные сети, если они есть
49-
],
116+
description:
117+
"Free guitar presets library for NUX Mighty Plug Pro and NUX Mighty Space devices",
118+
sameAs: [],
50119
}),
51120
}}
52121
/>

components/ClientSearch.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,20 @@
22

33
import { presets } from "lib/public/presets";
44
import { PresetCard } from "components/PresetCard";
5-
import { useState } from "react";
5+
import { useState, useEffect } from "react";
6+
import { useSearchParams } from "next/navigation";
67
import Link from "next/link";
78

89
export default function ClientSearch(): React.ReactElement {
9-
const [searchQuery, setSearchQuery] = useState("");
10+
const searchParams = useSearchParams();
11+
const initialQuery = searchParams.get("q") || "";
12+
const [searchQuery, setSearchQuery] = useState(initialQuery);
13+
14+
// Синхронизируем состояние с URL при изменении параметра q извне
15+
useEffect(() => {
16+
const queryFromUrl = searchParams.get("q") || "";
17+
setSearchQuery(queryFromUrl);
18+
}, [searchParams]);
1019

1120
const filteredPresets = presets
1221
.filter(

0 commit comments

Comments
 (0)