valaxy 0.25.1 → 0.25.2

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.
@@ -26,15 +26,15 @@ export function useValaxyApp() {
26
26
  // seo
27
27
  // todo: get first image url from markdown
28
28
  const siteUrl = computed(() => fm.value.url || siteConfig.value.url)
29
- const description = computed(() => fm.value.excerpt || fm.value.description || siteConfig.value.description)
29
+ const description = computed(() => $tO(fm.value.excerpt) || $tO(fm.value.description) || $tO(siteConfig.value.description))
30
30
 
31
31
  useSeoMeta({
32
32
  description,
33
33
  ogDescription: description,
34
34
  ogLocale: computed(() => locale.value || fm.value.lang || siteConfig.value.lang || 'en'),
35
35
  ogLocaleAlternate: computed(() => siteConfig.value.languages.filter(l => l !== locale.value)),
36
- ogSiteName: computed(() => siteConfig.value.title),
37
- ogTitle: computed(() => $tO(fm.value.title || siteConfig.value.title)),
36
+ ogSiteName: computed(() => $t(siteConfig.value.title)),
37
+ ogTitle: computed(() => $tO(fm.value.title) || $t(siteConfig.value.title)),
38
38
  ogImage: computed(() => fm.value.ogImage || fm.value.cover || siteConfig.value.favicon),
39
39
  ogType: 'website',
40
40
  ogUrl: siteUrl,
@@ -92,7 +92,7 @@ export function useValaxyI18n() {
92
92
  * "en": "Hello"
93
93
  * }
94
94
  */
95
- const $tO = (data?: string | Record<string, string>) => {
95
+ const $tO = <T = string>(data?: string | Record<string, T>) => {
96
96
  return tObject(data || '', locale.value)
97
97
  }
98
98
 
@@ -4,7 +4,7 @@ import yargs from "yargs";
4
4
  import { hideBin } from "yargs/helpers";
5
5
 
6
6
  // package.json
7
- var version = "0.25.1";
7
+ var version = "0.25.2";
8
8
 
9
9
  // node/modules/fuse.ts
10
10
  import path4 from "path";
@@ -3,7 +3,7 @@ import {
3
3
  registerDevCommand,
4
4
  run,
5
5
  startValaxyDev
6
- } from "../../chunk-JXEHOFBR.js";
6
+ } from "../../chunk-FOH2JIW7.js";
7
7
  export {
8
8
  cli,
9
9
  registerDevCommand,
@@ -50,7 +50,7 @@ import {
50
50
  startValaxyDev,
51
51
  toAtFS,
52
52
  transformObject
53
- } from "../chunk-JXEHOFBR.js";
53
+ } from "../chunk-FOH2JIW7.js";
54
54
  export {
55
55
  $t,
56
56
  ALL_ROUTE,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "valaxy",
3
3
  "type": "module",
4
- "version": "0.25.1",
4
+ "version": "0.25.2",
5
5
  "description": "📄 Vite & Vue powered static blog generator.",
6
6
  "author": {
7
7
  "email": "me@yunyoujun.cn",
@@ -132,8 +132,8 @@
132
132
  "vue-i18n": "^11.1.9",
133
133
  "vue-router": "^4.5.1",
134
134
  "yargs": "^18.0.0",
135
- "@valaxyjs/devtools": "0.25.1",
136
- "@valaxyjs/utils": "0.25.1"
135
+ "@valaxyjs/devtools": "0.25.2",
136
+ "@valaxyjs/utils": "0.25.2"
137
137
  },
138
138
  "devDependencies": {
139
139
  "@mdit-vue/plugin-component": "^2.1.4",
@@ -9,7 +9,7 @@
9
9
  * tObject({ 'en': 'English', 'zh-CN': '中文' }, 'fr') // English
10
10
  * ```
11
11
  */
12
- export function tObject(data: string | Record<string, string>, lang: string): string {
12
+ export function tObject<T = string>(data: string | Record<string, T>, lang: string): T | string {
13
13
  if (typeof data === 'object') {
14
14
  return data[lang] || Object.values(data)[0] || ''
15
15
  }