0.1.38 • Published 9 months ago
react-breadcrumbs-jsonld v0.1.38
react-breadcrumbs-jsonld
Overview
Dynamically generates JSON-LD structured for breadcrumbs in React.
Installation
You can install this library using npm:
npm install react-breadcrumbs-jsonld
Usage
url
must be an absolute path.- Must begin with either
http
orhttps
.
- Must begin with either
- URLs must be recursively nested.
Example
import { BreadcrumbSchema, BreadcrumbItem } from "react-breadcrumbs-jsonld";
function App() {
const breadcrumbs: BreadcrumbItem[] = [
{ url: "https://example.com/", name: "Home" },
{ url: "https://example.com/product/", name: "Products" },
{ url: "https://example.com/product/hoge", name: "Hoge" },
];
return (
<>
<BreadcrumbSchema breadcrumbs={breadcrumbs} />
</>
);
}
Output
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"item": {
"@id": "https://example.com/",
"name": "Home"
}
},
{
"@type": "ListItem",
"position": 2,
"item": {
"@id": "https://example.com/product/",
"name": "Products"
}
},
{
"@type": "ListItem",
"position": 3,
"item": {
"@id": "https://example.com/product/hoge",
"name": "Hoge"
}
}
]
}
</script>
Schema.org Test Result
Link
License
This project is licensed under the MIT License - see the LICENSE file for details.
0.1.36
9 months ago
0.1.37
9 months ago
0.1.38
9 months ago
0.1.30
11 months ago
0.1.31
11 months ago
0.1.32
10 months ago
0.1.33
10 months ago
0.1.34
10 months ago
0.1.35
10 months ago
0.1.28
11 months ago
0.1.29
11 months ago
0.1.27
12 months ago
0.1.20
1 year ago
0.1.21
1 year ago
0.1.22
1 year ago
0.1.23
1 year ago
0.1.24
1 year ago
0.1.25
12 months ago
0.1.26
12 months ago
0.1.17
1 year ago
0.1.18
1 year ago
0.1.19
1 year ago
0.1.14
1 year ago
0.1.15
1 year ago
0.1.16
1 year ago
0.1.12
1 year ago
0.1.13
1 year ago
0.1.10
1 year ago
0.1.11
1 year ago
0.1.8
1 year ago
0.1.9
1 year ago
0.1.2
1 year ago
0.1.7
1 year ago
0.1.4
1 year ago
0.1.3
1 year ago
0.1.6
1 year ago
0.1.5
1 year ago
0.1.1
2 years ago
0.1.0
2 years ago