valaxy 0.25.9 → 0.25.10

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.
@@ -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.9";
7
+ var version = "0.25.10";
8
8
 
9
9
  // node/modules/fuse.ts
10
10
  import path4 from "path";
@@ -523,7 +523,7 @@ var EXTERNAL_URL_RE = /^(?:[a-z]+:|\/\/)/i;
523
523
 
524
524
  // shared/utils/i18n.ts
525
525
  function tObject(data, lang) {
526
- if (typeof data === "object") {
526
+ if (data && typeof data === "object") {
527
527
  return data[lang] || Object.values(data)[0] || "";
528
528
  }
529
529
  return data;
@@ -900,7 +900,8 @@ async function isPagesDirExist(root) {
900
900
  // node/modules/fuse.ts
901
901
  async function generateFuseList(options) {
902
902
  consola9.start(`Generate List for Fuse Search by (${colors7.cyan("fuse.js")}) ...`);
903
- const files = await fg2(`${options.userRoot}/pages/posts/**/*.md`);
903
+ const pattern = options.config.siteConfig.fuse.pattern || path4.join(options.userRoot, "pages/**/*.md");
904
+ const files = await fg2(pattern);
904
905
  const posts = [];
905
906
  for await (const i of files) {
906
907
  const raw = fs7.readFileSync(i, "utf-8");
@@ -566,6 +566,14 @@ interface SiteConfig {
566
566
  * @description 搜索结果列表数据所在路径
567
567
  */
568
568
  dataPath: string;
569
+ /**
570
+ * fast-glob pattern to match Fuse List Data
571
+ * @default `pages\/**\/*.md`
572
+ * ```ts
573
+ * await fg(`${userRoot}/pages/posts/**\/*.md`)
574
+ * ```
575
+ */
576
+ pattern?: string;
569
577
  /**
570
578
  * @see https://fusejs.io/api/options.html
571
579
  */
@@ -3,7 +3,7 @@ import {
3
3
  registerDevCommand,
4
4
  run,
5
5
  startValaxyDev
6
- } from "../../chunk-MSK4KQXZ.js";
6
+ } from "../../chunk-JHXXCWZC.js";
7
7
  export {
8
8
  cli,
9
9
  registerDevCommand,
@@ -2,7 +2,7 @@ import { ViteSSGOptions } from 'vite-ssg';
2
2
  import * as vite from 'vite';
3
3
  import { UserConfig, InlineConfig, PluginOption, Plugin } from 'vite';
4
4
  import { MarkdownEnv } from 'unplugin-vue-markdown/types';
5
- import { D as DefaultTheme, V as ValaxyConfig, a as ValaxyAddon, P as PartialDeep, R as RuntimeConfig, b as RedirectItem, S as SiteConfig, U as UserSiteConfig } from '../config-CSOxBD5d.js';
5
+ import { D as DefaultTheme, V as ValaxyConfig, a as ValaxyAddon, P as PartialDeep, R as RuntimeConfig, b as RedirectItem, S as SiteConfig, U as UserSiteConfig } from '../config-bf4WqwPK.js';
6
6
  import Vue from '@vitejs/plugin-vue';
7
7
  import { Options as Options$2 } from 'beasties';
8
8
  import { Hookable } from 'hookable';
@@ -50,7 +50,7 @@ import {
50
50
  startValaxyDev,
51
51
  toAtFS,
52
52
  transformObject
53
- } from "../chunk-MSK4KQXZ.js";
53
+ } from "../chunk-JHXXCWZC.js";
54
54
  export {
55
55
  $t,
56
56
  ALL_ROUTE,
@@ -1,5 +1,5 @@
1
- import { c as PostFrontMatter, d as PageFrontMatter } from '../config-CSOxBD5d.js';
2
- export { A as Album, D as DefaultTheme, E as ExcerptType, F as FuseListItem, P as PartialDeep, i as Photo, g as Pkg, b as RedirectItem, f as RedirectRule, R as RuntimeConfig, S as SiteConfig, e as SocialLink, U as UserSiteConfig, h as UserValaxyConfig, a as ValaxyAddon, V as ValaxyConfig } from '../config-CSOxBD5d.js';
1
+ import { c as PostFrontMatter, d as PageFrontMatter } from '../config-bf4WqwPK.js';
2
+ export { A as Album, D as DefaultTheme, E as ExcerptType, F as FuseListItem, P as PartialDeep, i as Photo, g as Pkg, b as RedirectItem, f as RedirectRule, R as RuntimeConfig, S as SiteConfig, e as SocialLink, U as UserSiteConfig, h as UserValaxyConfig, a as ValaxyAddon, V as ValaxyConfig } from '../config-bf4WqwPK.js';
3
3
  import { Header } from '@valaxyjs/utils';
4
4
  import '@vueuse/integrations/useFuse';
5
5
  import 'medium-zoom';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "valaxy",
3
3
  "type": "module",
4
- "version": "0.25.9",
4
+ "version": "0.25.10",
5
5
  "description": "📄 Vite & Vue powered static blog generator.",
6
6
  "author": {
7
7
  "email": "me@yunyoujun.cn",
@@ -125,14 +125,14 @@
125
125
  "vite-plugin-vue-devtools": "^7.7.7",
126
126
  "vite-plugin-vue-layouts": "^0.11.0",
127
127
  "vite-ssg": "^28.0.0",
128
- "vite-ssg-sitemap": "^0.9.0",
128
+ "vite-ssg-sitemap": "^0.10.0",
129
129
  "vitepress-plugin-group-icons": "^1.6.1",
130
130
  "vue": "^3.5.17",
131
131
  "vue-i18n": "^11.1.10",
132
132
  "vue-router": "^4.5.1",
133
133
  "yargs": "^18.0.0",
134
- "@valaxyjs/devtools": "0.25.9",
135
- "@valaxyjs/utils": "0.25.9"
134
+ "@valaxyjs/devtools": "0.25.10",
135
+ "@valaxyjs/utils": "0.25.10"
136
136
  },
137
137
  "devDependencies": {
138
138
  "@mdit-vue/plugin-component": "^2.1.4",
@@ -10,7 +10,7 @@
10
10
  * ```
11
11
  */
12
12
  export function tObject<T = string>(data: string | Record<string, T>, lang: string): T | string {
13
- if (typeof data === 'object') {
13
+ if (data && typeof data === 'object') {
14
14
  return data[lang] || Object.values(data)[0] || ''
15
15
  }
16
16
  return data
package/types/config.ts CHANGED
@@ -180,6 +180,14 @@ export interface SiteConfig {
180
180
  * @description 搜索结果列表数据所在路径
181
181
  */
182
182
  dataPath: string
183
+ /**
184
+ * fast-glob pattern to match Fuse List Data
185
+ * @default `pages\/**\/*.md`
186
+ * ```ts
187
+ * await fg(`${userRoot}/pages/posts/**\/*.md`)
188
+ * ```
189
+ */
190
+ pattern?: string
183
191
  /**
184
192
  * @see https://fusejs.io/api/options.html
185
193
  */