valaxy 0.22.16 → 0.23.0

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.
@@ -1,4 +1,4 @@
1
- import { definePerson, defineWebPage, defineWebSite, useSchemaOrg } from '@unhead/schema-org'
1
+ import { definePerson, defineWebPage, defineWebSite, useSchemaOrg } from '@unhead/schema-org/vue'
2
2
  import { useSeoMeta } from '@unhead/vue'
3
3
 
4
4
  // TODO: add docs to override ValaxyApp
@@ -41,8 +41,8 @@ export function useValaxyApp() {
41
41
 
42
42
  // for SEO
43
43
  useSchemaOrg([
44
- // https://unhead.unjs.io/guide/guides/identity.html
45
- // Personal Website or Blog
44
+ // https://unhead.unjs.io/docs/schema-org/guides/recipes/identity
45
+ // Personal Website or Blog
46
46
  definePerson({
47
47
  name: siteConfig.value.author.name,
48
48
  url: siteUrl.value,
@@ -1,4 +1,4 @@
1
- import type { PostFrontMatter } from 'valaxy/types'
1
+ import type { PostFrontMatter } from '../../types'
2
2
  import type { ValaxyData } from '../app/data'
3
3
  import { isClient } from '@vueuse/core'
4
4
 
@@ -1,5 +1,5 @@
1
1
  import type { MenuItem } from '@valaxyjs/utils'
2
- import type { DefaultTheme } from 'valaxy/types'
2
+ import type { DefaultTheme } from '../../../types'
3
3
  import { getHeaders } from '@valaxyjs/utils'
4
4
  import { computed, shallowRef } from 'vue'
5
5
  import { useFrontmatter, useThemeConfig } from '../..'
@@ -1,6 +1,6 @@
1
1
  import type { UseFuseOptions } from '@vueuse/integrations/useFuse'
2
2
  import type { MaybeRefOrGetter } from '@vueuse/shared'
3
- import type { FuseListItem } from 'valaxy/types'
3
+ import type { FuseListItem } from '../../../types'
4
4
  import { useFuse } from '@vueuse/integrations/useFuse'
5
5
  import { useSiteConfig } from 'valaxy'
6
6
  import { computed, shallowRef } from 'vue'
package/client/config.ts CHANGED
@@ -1,10 +1,10 @@
1
+ import type { ComputedRef, InjectionKey } from 'vue'
2
+
1
3
  // import type { RouteMeta } from 'vue-router'
2
4
  // fix build caused by pnpm
3
5
  // This is likely not portable. A type annotation is necessary.
4
6
  // https://github.com/microsoft/TypeScript/issues/42873
5
- import type { DefaultTheme, ValaxyConfig } from 'valaxy/types'
6
-
7
- import type { ComputedRef, InjectionKey } from 'vue'
7
+ import type { DefaultTheme, ValaxyConfig } from '../types'
8
8
  import type { ValaxyData } from './app/data'
9
9
  import { computed, inject, readonly, shallowRef } from 'vue'
10
10
 
@@ -0,0 +1,13 @@
1
+ import type { UserModule } from '../types'
2
+ import { InferSeoMetaPlugin } from '@unhead/addons'
3
+
4
+ export const install: UserModule = async ({ head, isClient }) => {
5
+ // Disables on client build, allows 0kb runtime
6
+ if (isClient && import.meta.env.PROD)
7
+ return
8
+
9
+ /**
10
+ * https://unhead.unjs.io/docs/head/guides/plugins/infer-seo-meta-tags
11
+ */
12
+ head?.use(InferSeoMetaPlugin())
13
+ }
@@ -8,11 +8,11 @@ import type { ViteSSGContext } from 'vite-ssg'
8
8
 
9
9
  import type { ComputedRef } from 'vue'
10
10
 
11
- import consola from 'consola'
11
+ import { consola } from 'consola'
12
12
  import { install as installFloatingVue } from '../modules/floating-vue'
13
13
  import { install as installNprogress } from '../modules/nprogress'
14
14
  import { install as installPinia } from '../modules/pinia'
15
- import { install as installSchema } from '../modules/schemaOrg'
15
+ import { install as installUnhead } from '../modules/unhead'
16
16
  import { install as installValaxy } from '../modules/valaxy'
17
17
 
18
18
  export default function setupMain(ctx: ViteSSGContext, config: ComputedRef<ValaxyConfig<DefaultTheme.Config>>) {
@@ -21,7 +21,7 @@ export default function setupMain(ctx: ViteSSGContext, config: ComputedRef<Valax
21
21
  const injection_arg = ctx
22
22
 
23
23
  installValaxy(ctx, config)
24
- installSchema(ctx)
24
+ installUnhead(ctx)
25
25
  installPinia(ctx)
26
26
  installNprogress(ctx)
27
27
  installFloatingVue(ctx, config)
@@ -25,6 +25,8 @@
25
25
 
26
26
  // custom block
27
27
  .custom-block {
28
+ margin: 16px 0;
29
+
28
30
  p {
29
31
  margin: 8px 0;
30
32
  line-height: 24px;