Skip to content

Commit 0b42ed4

Browse files
authored
Merge pull request #14 from vueuse/feat/migrate-schema-org-graph-js
feat: migrate to schema-org-graph-js
2 parents 4216cea + 564e8ec commit 0b42ed4

File tree

123 files changed

+7301
-8835
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+7301
-8835
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,24 @@ Schema.org for Vue. Supports typed and automated Google Rich Results
1919
<table>
2020
<tbody>
2121
<td align="center">
22-
<img width="2000" height="0" /><br>
22+
<img width="830" height="0" /><br>
2323
<i>Status:</i> <b>Early Access</b> <br>
2424
<sup> Please report any issues 🐛</sup><br>
2525
<sub>Made possible by my <a href="https://github.com/sponsors/harlan-zw">Sponsor Program 💖</a><br> Follow me <a href="https://twitter.com/harlan_zw">@harlan_zw</a> 🐦</sub><br>
26-
<img width="2000" height="0" />
26+
<img width="830" height="0" />
2727
</td>
2828
</tbody>
2929
</table>
3030
</p>
3131

3232
## Features
3333

34-
- 😊 No Schema.org knowledge required, get up and running in minutes with minimal configuration
35-
- ✨ 20+ Typed Schemas for best practice ([Google](https://developers.google.com/search/docs/advanced/structured-data/search-gallery), [Yoast](https://developer.yoast.com/features/schema/overview)) Rich Results
34+
- ✨ Powered [schema-org-graph-js](https://github.com/harlan-zw/schema-org-graph-js): No Schema.org knowledge required, 20+ Typed Schemas
3635
- 🧙 Automated Schema: `@id`, URL / date resolving, route meta and more
3736
- 🤝 Integrations for [VitePress](https://vitepress.vue.com), [Nuxt](https://nuxtjs.org/), [Vitesse](https://nuxtjs.org/) and [Vite](https://vitejs.dev/) with auto-imports
3837
- 🍞 Choose your preferred API: Composables or Components
39-
- 🌳 SSR, tree-shaking and Schema inheritance ready
38+
- ⛏️ Choose your preferred Schema.org types: simple or full (schema-dts)
39+
- 🌳 **0 kB client runtime**, SSR, tree-shaking
4040

4141
## Background
4242

docs/.vitepress/theme/MyLayout.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ const route = useRoute()
2727
<template #doc-after>
2828
<div style="margin-top: 50px;">
2929
<p class="italic">Preview of <a href="/guide/debugging.html#component-schemaorginspector">SchemaOrgInspector</a> displaying current Schema for the page.</p>
30-
<SchemaOrgInspector style="max-width: 100%;" />
3130
</div>
3231
</template>
3332
</Layout>

docs/api/core/create-schema-org.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@
1111

1212
const schemaOrg = createSchemaOrg({
1313
...options,
14-
provider: {
15-
setupDOM: useVueUseHead(head),
16-
provider: 'vitesse',
17-
useRoute: () => ctx.router.currentRoute.value,
18-
},
14+
setupDOM: useVueUseHead(head),
1915
})
2016
```
2117
**CreateSchemaOrgInput**

docs/components.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ declare module '@vue/runtime-core' {
2424
Links: typeof import('./src/components/Links.vue')['default']
2525
RouterLink: typeof import('vue-router')['RouterLink']
2626
RouterView: typeof import('vue-router')['RouterView']
27-
SchemaOrgInspector: typeof import('@vueuse/schema-org')['SchemaOrgInspector']
28-
SchemaOrgPerson: typeof import('@vueuse/schema-org')['SchemaOrgPerson']
29-
SchemaOrgWebPage: typeof import('@vueuse/schema-org')['SchemaOrgWebPage']
30-
SchemaOrgWebSite: typeof import('@vueuse/schema-org')['SchemaOrgWebSite']
27+
SchemaOrgInspector: typeof import('#vueuse/schema-org/runtime')['SchemaOrgInspector']
28+
SchemaOrgPerson: typeof import('#vueuse/schema-org/runtime')['SchemaOrgPerson']
29+
SchemaOrgWebPage: typeof import('#vueuse/schema-org/runtime')['SchemaOrgWebPage']
30+
SchemaOrgWebSite: typeof import('#vueuse/schema-org/runtime')['SchemaOrgWebSite']
3131
SponsorBanner: typeof import('./src/components/SponsorBanner.vue')['default']
3232
}
3333
}

docs/components/index.md

Lines changed: 5 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -55,60 +55,17 @@ will be the resolved node.
5555
<SchemaOrgQuestion>
5656
<!-- Scoped slots won't render anything -->
5757
<template #name>
58-
What is quantum mechanics?
58+
{{ question }}
5959
</template>
6060
<template #acceptedAnswer>
61-
<p>Quantum mechanics is the study of the nature of matter.</p>
62-
<p>It is the study of the nature of the interaction between particles and the nature of the universe.</p>
63-
<p>Particles are the smallest particles in the universe.</p>
64-
<p>The universe is made up of particles.</p>
65-
<p>Particles are made up of matter.</p>
66-
<p>Matter is made up of energy.</p>
67-
<p>Energy is made up of heat.</p>
68-
<p>Heat is made up of light.</p>
69-
<p>Light is made up of sound.</p>
70-
<p>Sound is made up of colour.</p>
71-
<p>Colour is made up of light.</p>
72-
<p>Light is made up of light.</p>
61+
<div v-html="answer" />
7362
</template>
7463
<!-- Default slot will render -->
75-
<template #default="{ acceptedAnswer, name }">
64+
<template>
7665
<h2>
77-
# {{ name }}
66+
{{ question }}
7867
</h2>
79-
<p v-html="acceptedAnswer.text" />
80-
<div>Wow!</div>
81-
</template>
82-
</SchemaOrgQuestion>
83-
</template>
84-
```
85-
86-
87-
## Rendered Scoped Slots
88-
89-
Providing the `render-scoped-slots` will allow the slots to be rendered. This is useful in avoiding having markup in your
90-
template twice.
91-
92-
```vue
93-
<template>
94-
<SchemaOrgQuestion v-slot="{ acceptedAnswer, name}" render-scoped-slots>
95-
<!-- Scoped slots will render -->
96-
<template #name>
97-
<h3>What is quantum mechanics?</h3>
98-
</template>
99-
<template #acceptedAnswer>
100-
<p>Quantum mechanics is the study of the nature of matter.</p>
101-
<p>It is the study of the nature of the interaction between particles and the nature of the universe.</p>
102-
<p>Particles are the smallest particles in the universe.</p>
103-
<p>The universe is made up of particles.</p>
104-
<p>Particles are made up of matter.</p>
105-
<p>Matter is made up of energy.</p>
106-
<p>Energy is made up of heat.</p>
107-
<p>Heat is made up of light.</p>
108-
<p>Light is made up of sound.</p>
109-
<p>Sound is made up of colour.</p>
110-
<p>Colour is made up of light.</p>
111-
<p>Light is made up of light.</p>
68+
<div v-html="answer" />
11269
</template>
11370
</SchemaOrgQuestion>
11471
</template>

docs/guide/setup/vite.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ const head = createHead()
4343
app.use(head)
4444

4545
const schemaOrg = createSchemaOrg({
46-
provider: {
47-
useRoute: () => router.currentRoute,
48-
setupDOM: useVueUseHead(head)
49-
}
46+
setupDOM: useVueUseHead(head),
5047
/* config */
5148
})
49+
watch(() => router.currentRoute, () => {
50+
// @todo
51+
})
5252
app.use(schemaOrg)
5353
schemaOrg.setupDOM()
5454

docs/package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,25 @@
99
},
1010
"dependencies": {
1111
"@panelbear/panelbear-js": "^1.3.3",
12-
"@vueuse/core": "^8.9.4",
12+
"@vueuse/core": "^9.1.0",
1313
"@vueuse/schema-org": "link:../packages/schema-org",
1414
"@vueuse/schema-org-vite": "link:../packages/vite",
1515
"change-case": "^4.1.2",
1616
"typewriter-effect": "^2.18.2",
17-
"unplugin-auto-import": "^0.9.3",
18-
"unplugin-icons": "^0.14.7",
19-
"vite": "^3.0.0",
17+
"unplugin-auto-import": "^0.11.1",
18+
"unplugin-icons": "^0.14.8",
19+
"vite": "^3.0.7",
2020
"vite-plugin-windicss": "^1.8.7",
2121
"vue": "^3.2.37"
2222
},
2323
"devDependencies": {
24-
"@iconify-json/carbon": "^1.1.6",
25-
"@iconify-json/logos": "^1.1.10",
26-
"@unocss/reset": "^0.44.3",
27-
"@vitejs/plugin-vue": "^3.0.0",
24+
"@iconify-json/carbon": "^1.1.7",
25+
"@iconify-json/logos": "^1.1.14",
26+
"@unocss/reset": "^0.45.6",
27+
"@vitejs/plugin-vue": "^3.0.3",
2828
"markdown-it": "^13.0.1",
29-
"unocss": "^0.44.3",
30-
"unplugin-vue-components": "^0.21.1",
29+
"unocss": "^0.45.6",
30+
"unplugin-vue-components": "^0.22.4",
3131
"vitepress": "^1.0.0-alpha.4"
3232
}
3333
}

0 commit comments

Comments
 (0)