valaxy 0.14.31 → 0.14.33

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.
package/client/App.vue CHANGED
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { computed, provide, ref } from 'vue'
2
+ import { computed, onBeforeMount, provide, ref } from 'vue'
3
3
  import { useHead, useSeoMeta } from '@vueuse/head'
4
4
 
5
5
  // @ts-expect-error virtual module
@@ -10,6 +10,7 @@ import ValaxyThemeApp from '/@valaxyjs/ThemeAppVue'
10
10
  import pkg from 'valaxy/package.json'
11
11
  import { useI18n } from 'vue-i18n'
12
12
  import { definePerson, defineWebPage, defineWebSite, useSchemaOrg } from '@vueuse/schema-org'
13
+ import dayjs from 'dayjs'
13
14
  import ValaxyAddons from './components/ValaxyAddons.vue'
14
15
  import { isDark, useFrontmatter } from './composables'
15
16
 
@@ -59,13 +60,15 @@ useHead({
59
60
  // seo
60
61
  // todo: get first image url from markdown
61
62
  const siteUrl = computed(() => fm.value.url || siteConfig.value.url)
63
+ const description = computed(() => fm.value.excerpt || fm.value.description || siteConfig.value.description)
64
+
62
65
  useSeoMeta({
63
- description: computed(() => fm.value.excerpt || siteConfig.value.description),
64
- ogDescription: computed(() => fm.value.excerpt || siteConfig.value.description),
66
+ description,
67
+ ogDescription: description,
65
68
  ogLocale: computed(() => fm.value.lang || siteConfig.value.lang),
66
69
  ogSiteName: computed(() => siteConfig.value.title),
67
70
  ogTitle: computed(() => fm.value.title || siteConfig.value.title),
68
- ogImage: computed(() => siteConfig.value.favicon),
71
+ ogImage: computed(() => fm.value.ogImage || fm.value.cover || siteConfig.value.favicon),
69
72
  ogUrl: siteUrl,
70
73
  })
71
74
 
@@ -89,6 +92,11 @@ useSchemaOrg([
89
92
  }),
90
93
  defineWebPage(),
91
94
  ])
95
+
96
+ onBeforeMount(() => {
97
+ if (siteConfig.value.timezone)
98
+ dayjs.tz.setDefault(siteConfig.value.timezone)
99
+ })
92
100
  </script>
93
101
 
94
102
  <template>
@@ -3,6 +3,7 @@ import type { ViteSSGContext } from 'vite-ssg'
3
3
 
4
4
  import dayjs from 'dayjs'
5
5
  import relativeTime from 'dayjs/plugin/relativeTime'
6
+ import timezone from 'dayjs/plugin/timezone'
6
7
 
7
8
  import { install as installValaxy } from '../modules/valaxy'
8
9
  import { install as installPinia } from '../modules/pinia'
@@ -23,6 +24,7 @@ export default function setupMain(ctx: ViteSSGContext) {
23
24
 
24
25
  // dayjs
25
26
  dayjs.extend(relativeTime)
27
+ dayjs.extend(timezone)
26
28
 
27
29
  /* __injections__ */
28
30
  }