@unhead/schema-org 2.0.14 → 2.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +150 -4
  2. package/package.json +12 -12
package/README.md CHANGED
@@ -1,9 +1,155 @@
1
- #
1
+ # @unhead/schema-org
2
2
 
3
- Schema.org for Vue. Supports typed and automated Google Rich Results
3
+ > Unhead Schema.org for Simple and Automated Google Rich Results
4
4
 
5
- [Documentation](https://unhead.unjs.io/schema-org)
5
+ [![npm version][npm-version-src]][npm-version-href]
6
+ [![npm downloads][npm-downloads-src]][npm-downloads-href]
7
+ [![License][license-src]][license-href]
8
+
9
+ ## Features
10
+
11
+ - 🔍 **Google Rich Results** - Automated schema generation for rich search results
12
+ - 🎯 **Type-safe** - Full TypeScript support with schema validation
13
+ - 🖖 **Framework agnostic** - Works with Vue, React, Svelte, SolidJS, and more
14
+ - 📋 **80+ Schema Types** - Support for most common schema.org types
15
+ - ⚡ **Zero runtime** - Generates optimized JSON-LD at build time
16
+ - 🔄 **Reactive** - Dynamic schema updates with framework reactivity
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ # npm
22
+ npm install @unhead/schema-org
23
+
24
+ # yarn
25
+ yarn add @unhead/schema-org
26
+
27
+ # pnpm
28
+ pnpm add @unhead/schema-org
29
+ ```
30
+
31
+ ## Usage
32
+
33
+ ### Vue
34
+
35
+ ```vue
36
+ <script setup>
37
+ import { defineWebPage, defineWebSite, useSchemaOrg } from '@unhead/schema-org/vue'
38
+
39
+ useSchemaOrg([
40
+ defineWebSite({
41
+ name: 'My Website',
42
+ url: 'https://example.com',
43
+ }),
44
+ defineWebPage({
45
+ title: 'About Us',
46
+ description: 'Learn more about our company',
47
+ })
48
+ ])
49
+ </script>
50
+ ```
51
+
52
+ ### React
53
+
54
+ ```jsx
55
+ import { defineWebPage, defineWebSite, useSchemaOrg } from '@unhead/schema-org/react'
56
+
57
+ function About() {
58
+ useSchemaOrg([
59
+ defineWebSite({
60
+ name: 'My Website',
61
+ url: 'https://example.com',
62
+ }),
63
+ defineWebPage({
64
+ title: 'About Us',
65
+ description: 'Learn more about our company',
66
+ })
67
+ ])
68
+
69
+ return <h1>About Us</h1>
70
+ }
71
+ ```
72
+
73
+ ### Framework Agnostic
74
+
75
+ ```ts
76
+ import { defineWebPage, useSchemaOrg } from '@unhead/schema-org'
77
+
78
+ // Provide your unhead instance
79
+ useSchemaOrg([
80
+ defineWebPage({
81
+ title: 'My Page',
82
+ description: 'Page description'
83
+ })
84
+ ], { head: myHeadInstance })
85
+ ```
86
+
87
+ ## Common Schema Types
88
+
89
+ ### Article
90
+
91
+ ```ts
92
+ import { defineArticle } from '@unhead/schema-org'
93
+
94
+ defineArticle({
95
+ headline: 'How to use Schema.org',
96
+ description: 'Learn how to implement schema.org',
97
+ author: {
98
+ name: 'John Doe',
99
+ url: 'https://johndoe.com'
100
+ },
101
+ datePublished: '2023-01-01',
102
+ dateModified: '2023-01-15'
103
+ })
104
+ ```
105
+
106
+ ### Organization
107
+
108
+ ```ts
109
+ import { defineOrganization } from '@unhead/schema-org'
110
+
111
+ defineOrganization({
112
+ name: 'My Company',
113
+ url: 'https://mycompany.com',
114
+ logo: 'https://mycompany.com/logo.png',
115
+ sameAs: [
116
+ 'https://twitter.com/mycompany',
117
+ 'https://linkedin.com/company/mycompany'
118
+ ]
119
+ })
120
+ ```
121
+
122
+ ### Product
123
+
124
+ ```ts
125
+ import { defineProduct } from '@unhead/schema-org'
126
+
127
+ defineProduct({
128
+ name: 'Amazing Product',
129
+ description: 'The most amazing product ever',
130
+ image: 'https://example.com/product.jpg',
131
+ offers: {
132
+ price: '29.99',
133
+ priceCurrency: 'USD',
134
+ availability: 'InStock'
135
+ }
136
+ })
137
+ ```
138
+
139
+ ## Documentation
140
+
141
+ Visit the [Schema.org documentation](https://unhead.unjs.io/schema-org) for comprehensive guides and all available schema types.
6
142
 
7
143
  ## License
8
144
 
9
- MIT License © 2022-PRESENT [Harlan Wilton](https://github.com/harlan-zw)
145
+ [MIT](./LICENSE)
146
+
147
+ <!-- Badges -->
148
+ [npm-version-src]: https://img.shields.io/npm/v/@unhead/schema-org/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
149
+ [npm-version-href]: https://npmjs.com/package/@unhead/schema-org
150
+
151
+ [npm-downloads-src]: https://img.shields.io/npm/dm/@unhead/schema-org.svg?style=flat&colorA=18181B&colorB=28CF8D
152
+ [npm-downloads-href]: https://npmjs.com/package/@unhead/schema-org
153
+
154
+ [license-src]: https://img.shields.io/github/license/unjs/unhead.svg?style=flat&colorA=18181B&colorB=28CF8D
155
+ [license-href]: https://github.com/unjs/unhead/blob/main/LICENSE
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unhead/schema-org",
3
3
  "type": "module",
4
- "version": "2.0.14",
4
+ "version": "2.0.18",
5
5
  "description": "Unhead Schema.org for Simple and Automated Google Rich Results",
6
6
  "author": "Harlan Wilton <harlan@harlanzw.com>",
7
7
  "license": "MIT",
@@ -71,10 +71,10 @@
71
71
  "dist"
72
72
  ],
73
73
  "peerDependencies": {
74
- "@unhead/react": "2.0.14",
75
- "@unhead/solid-js": "2.0.14",
76
- "@unhead/svelte": "2.0.14",
77
- "@unhead/vue": "2.0.14"
74
+ "@unhead/svelte": "2.0.18",
75
+ "@unhead/react": "2.0.18",
76
+ "@unhead/solid-js": "2.0.18",
77
+ "@unhead/vue": "2.0.18"
78
78
  },
79
79
  "peerDependenciesMeta": {
80
80
  "@unhead/react": {
@@ -94,15 +94,15 @@
94
94
  "defu": "^6.1.4",
95
95
  "ohash": "^2.0.11",
96
96
  "ufo": "^1.6.1",
97
- "unhead": "2.0.14"
97
+ "unhead": "2.0.18"
98
98
  },
99
99
  "devDependencies": {
100
- "unplugin-vue-components": "^28.8.0",
101
- "@unhead/solid-js": "2.0.14",
102
- "@unhead/react": "2.0.14",
103
- "@unhead/vue": "2.0.14",
104
- "@unhead/svelte": "2.0.14",
105
- "unhead": "2.0.14"
100
+ "unplugin-vue-components": "^29.0.0",
101
+ "@unhead/react": "2.0.18",
102
+ "@unhead/solid-js": "2.0.18",
103
+ "@unhead/svelte": "2.0.18",
104
+ "unhead": "2.0.18",
105
+ "@unhead/vue": "2.0.18"
106
106
  },
107
107
  "build": {
108
108
  "external": [