valaxy 0.22.3 → 0.22.5-beta.4

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,3 +1,13 @@
1
+ <script setup lang="ts">
2
+ // import { defineAsyncComponent } from 'vue'
3
+ /**
4
+ * @see @valaxyjs/devtools
5
+ */
6
+ // const ValaxyDevtoolsEntry = import.meta.env
7
+ // ? defineAsyncComponent(() => import('@valaxyjs/devtools/src/client/components/ValaxyDevtoolsEntry.vue'))
8
+ // : () => null
9
+ </script>
10
+
1
11
  <template>
2
12
  <ValaxyApp />
3
13
  </template>
@@ -1,18 +1,6 @@
1
1
  <script setup lang="ts">
2
- import { definePerson, defineWebPage, defineWebSite, useSchemaOrg } from '@unhead/schema-org'
3
- import { useSeoMeta } from '@unhead/vue'
2
+ import { useLayout, useValaxyApp } from '../composables'
4
3
 
5
- // TODO: add docs to override ValaxyApp
6
- import { computed } from 'vue'
7
- import { useI18n } from 'vue-i18n'
8
-
9
- import { useFrontmatter, useValaxyHead } from '../composables'
10
- import { useTimezone } from '../composables/global'
11
-
12
- // https://github.com/vueuse/head
13
- // you can use this to manipulate the document head in any components,
14
- // they will be rendered correctly in the html results with vite-ssg
15
- import { useSiteConfig } from '../config'
16
4
  import ValaxyAddons from './ValaxyAddons.vue'
17
5
  // @ts-expect-error virtual module
18
6
  import ValaxyThemeApp from '/@valaxyjs/ThemeAppVue'
@@ -22,57 +10,18 @@ import ValaxyUserApp from '/@valaxyjs/UserAppVue'
22
10
  // <link rel="apple-touch-icon" href="/pwa-192x192.png">
23
11
  // <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#00aba9">
24
12
 
25
- const siteConfig = useSiteConfig()
26
- // todo, allow user config
27
- const fm = useFrontmatter()
28
-
29
- const { locale } = useI18n()
30
-
31
- const title = computed(() => fm.value[`title_${locale.value}`] || fm.value.title)
32
-
33
- // seo
34
- // todo: get first image url from markdown
35
- const siteUrl = computed(() => fm.value.url || siteConfig.value.url)
36
- const description = computed(() => fm.value.excerpt || fm.value.description || siteConfig.value.description)
37
-
38
- useSeoMeta({
39
- description,
40
- ogDescription: description,
41
- ogLocale: computed(() => locale.value || fm.value.lang || siteConfig.value.lang || 'en'),
42
- ogLocaleAlternate: computed(() => siteConfig.value.languages.filter(l => l !== locale.value)),
43
- ogSiteName: computed(() => siteConfig.value.title),
44
- ogTitle: computed(() => fm.value.title || siteConfig.value.title),
45
- ogImage: computed(() => fm.value.ogImage || fm.value.cover || siteConfig.value.favicon),
46
- ogType: 'website',
47
- ogUrl: siteUrl,
48
- })
49
-
50
- // for SEO
51
- useSchemaOrg([
52
- // https://unhead.unjs.io/guide/guides/identity.html
53
- // Personal Website or Blog
54
- definePerson({
55
- name: siteConfig.value.author.name,
56
- url: siteUrl.value,
57
- image: siteConfig.value.author.avatar,
58
- sameAs: siteConfig.value.social.map(s => s.link),
59
- }),
60
- defineWebSite({
61
- name: title.value,
62
- datePublished: computed(() => fm.value.date),
63
- dateModified: computed(() => fm.value.updated),
64
- }),
65
- defineWebPage(),
66
- ])
67
-
68
- useTimezone()
13
+ const layout = useLayout()
69
14
 
70
- useValaxyHead()
15
+ if (layout.value !== 'empty') {
16
+ useValaxyApp()
17
+ }
71
18
  </script>
72
19
 
73
20
  <template>
74
- <ValaxyThemeApp />
75
- <ValaxyAddons />
76
- <ValaxyUserApp />
21
+ <template v-if="layout !== 'empty'">
22
+ <ValaxyThemeApp />
23
+ <ValaxyAddons />
24
+ <ValaxyUserApp />
25
+ </template>
77
26
  <router-view />
78
27
  </template>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <svg width="1024" height="1024" viewBox="0 0 1024 1024" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <svg viewBox="0 0 1024 1024" fill="none" xmlns="http://www.w3.org/2000/svg">
3
3
  <mask id="mask0_757_102259" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="97" y="222" width="830" height="647">
4
4
  <path fill-rule="evenodd" clip-rule="evenodd" d="M729.48 756.469C729.478 756.471 729.475 756.473 729.472 756.475C729.606 756.361 729.625 756.36 729.48 756.469ZM690.046 767.723C685.618 766.845 680.868 765.982 675.803 765.143C634.63 758.32 576.843 753.701 512.383 753.12C447.923 752.538 390.063 756.114 348.774 762.193C343.694 762.941 338.929 763.717 334.486 764.515C338.914 765.394 343.664 766.256 348.729 767.095C389.902 773.918 447.689 778.537 512.149 779.119C576.609 779.7 634.469 776.124 675.758 770.045C680.838 769.298 685.603 768.521 690.046 767.723ZM295.261 752.552C295.118 752.441 295.137 752.442 295.269 752.558C295.266 752.556 295.264 752.554 295.261 752.552ZM295.052 775.769C295.054 775.768 295.057 775.766 295.06 775.764C294.926 775.877 294.907 775.878 295.052 775.769ZM729.263 779.68C729.266 779.682 729.268 779.684 729.271 779.686C729.413 779.798 729.395 779.796 729.263 779.68ZM511.932 803.118C642.542 804.296 748.572 788.686 748.756 768.252C748.941 747.819 643.21 730.299 512.6 729.121C381.99 727.942 275.96 743.552 275.776 763.986C275.591 784.42 381.322 801.939 511.932 803.118Z" fill="url(#paint0_linear_757_102259)" />
5
5
  <path fill-rule="evenodd" clip-rule="evenodd" d="M729.48 756.469C729.478 756.471 729.475 756.473 729.472 756.475C729.606 756.361 729.625 756.36 729.48 756.469ZM690.046 767.723C685.618 766.845 680.868 765.982 675.803 765.143C634.63 758.32 576.843 753.701 512.383 753.12C447.923 752.538 390.063 756.114 348.774 762.193C343.694 762.941 338.929 763.717 334.486 764.515C338.914 765.394 343.664 766.256 348.729 767.095C389.902 773.918 447.689 778.537 512.149 779.119C576.609 779.7 634.469 776.124 675.758 770.045C680.838 769.298 685.603 768.521 690.046 767.723ZM295.261 752.552C295.118 752.441 295.137 752.442 295.269 752.558C295.266 752.556 295.264 752.554 295.261 752.552ZM295.052 775.769C295.054 775.768 295.057 775.766 295.06 775.764C294.926 775.877 294.907 775.878 295.052 775.769ZM729.263 779.68C729.266 779.682 729.268 779.684 729.271 779.686C729.413 779.798 729.395 779.796 729.263 779.68ZM511.932 803.118C642.542 804.296 748.572 788.686 748.756 768.252C748.941 747.819 643.21 730.299 512.6 729.121C381.99 727.942 275.96 743.552 275.776 763.986C275.591 784.42 381.322 801.939 511.932 803.118Z" fill="url(#paint1_linear_757_102259)" />
@@ -1 +1,2 @@
1
+ export * from './useValaxyApp'
1
2
  export * from './useValaxyHead'
@@ -0,0 +1,63 @@
1
+ import { definePerson, defineWebPage, defineWebSite, useSchemaOrg } from '@unhead/schema-org'
2
+ import { useSeoMeta } from '@unhead/vue'
3
+
4
+ // TODO: add docs to override ValaxyApp
5
+ import { computed } from 'vue'
6
+ import { useI18n } from 'vue-i18n'
7
+
8
+ import { useFrontmatter, useValaxyHead } from '../../composables'
9
+ import { useTimezone } from '../../composables/global'
10
+
11
+ // https://github.com/vueuse/head
12
+ // you can use this to manipulate the document head in any components,
13
+ // they will be rendered correctly in the html results with vite-ssg
14
+ import { useSiteConfig } from '../../config'
15
+
16
+ export function useValaxyApp() {
17
+ const siteConfig = useSiteConfig()
18
+ // todo, allow user config
19
+ const fm = useFrontmatter()
20
+
21
+ const { locale } = useI18n()
22
+
23
+ const title = computed(() => fm.value[`title_${locale.value}`] || fm.value.title)
24
+
25
+ // seo
26
+ // todo: get first image url from markdown
27
+ const siteUrl = computed(() => fm.value.url || siteConfig.value.url)
28
+ const description = computed(() => fm.value.excerpt || fm.value.description || siteConfig.value.description)
29
+
30
+ useSeoMeta({
31
+ description,
32
+ ogDescription: description,
33
+ ogLocale: computed(() => locale.value || fm.value.lang || siteConfig.value.lang || 'en'),
34
+ ogLocaleAlternate: computed(() => siteConfig.value.languages.filter(l => l !== locale.value)),
35
+ ogSiteName: computed(() => siteConfig.value.title),
36
+ ogTitle: computed(() => fm.value.title || siteConfig.value.title),
37
+ ogImage: computed(() => fm.value.ogImage || fm.value.cover || siteConfig.value.favicon),
38
+ ogType: 'website',
39
+ ogUrl: siteUrl,
40
+ })
41
+
42
+ // for SEO
43
+ useSchemaOrg([
44
+ // https://unhead.unjs.io/guide/guides/identity.html
45
+ // Personal Website or Blog
46
+ definePerson({
47
+ name: siteConfig.value.author.name,
48
+ url: siteUrl.value,
49
+ image: siteConfig.value.author.avatar,
50
+ sameAs: siteConfig.value.social.map(s => s.link),
51
+ }),
52
+ defineWebSite({
53
+ name: title.value,
54
+ datePublished: computed(() => fm.value.date),
55
+ dateModified: computed(() => fm.value.updated),
56
+ }),
57
+ defineWebPage(),
58
+ ])
59
+
60
+ useTimezone()
61
+
62
+ useValaxyHead()
63
+ }
package/client/index.ts CHANGED
@@ -5,6 +5,7 @@ export * from './config'
5
5
 
6
6
  // extend define
7
7
  export * from './define'
8
+
8
9
  export * from './setups'
9
10
 
10
11
  export * from './stores'
@@ -21,6 +21,7 @@ export async function addValaxyTabAndCommand() {
21
21
  // iframe view
22
22
  view: {
23
23
  type: 'iframe',
24
+ // src: import.meta.env.DEV ? 'http://localhost:5001/' : '/__valaxy_devtools__/',
24
25
  src: '/__valaxy_devtools__/',
25
26
  },
26
27
  // category: 'pinned',