valaxy 0.17.3 → 0.17.5

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,6 +1,7 @@
1
1
  import { ZoomOptions } from 'medium-zoom';
2
2
  import { FuseOptions } from '@vueuse/integrations/useFuse';
3
3
  import { ILazyLoadOptions } from 'vanilla-lazyload';
4
+ import { RouteRecordRaw } from 'vue-router';
4
5
  import { NodeRelations, ImageObject } from '@unhead/schema-org';
5
6
 
6
7
  interface ValaxyAddon<AddonOptions = Record<string, any>> {
@@ -185,6 +186,11 @@ interface PageFrontMatter extends Record<string, any> {
185
186
  * @description:zh-CN 限制代码块的高度,单位是 px
186
187
  */
187
188
  codeHeightLimit?: number;
189
+ /**
190
+ * @description:en-US Source path for client redirection
191
+ * @description:zh-CN 客户端重定向的源路径
192
+ */
193
+ from?: string | string[];
188
194
  }
189
195
  interface PostFrontMatter extends PageFrontMatter {
190
196
  /**
@@ -279,6 +285,10 @@ interface RedirectRule {
279
285
  to: string;
280
286
  from: string | string[];
281
287
  }
288
+ interface RedirectItem {
289
+ from: string;
290
+ to: string;
291
+ }
282
292
  interface SiteConfig {
283
293
  /**
284
294
  * enable auto (light/dark mode)
@@ -552,7 +562,10 @@ interface SiteConfig {
552
562
  * @description:en-US client redirect rules
553
563
  * @description:zh-CN 客户端重定向规则
554
564
  */
555
- redirects?: RedirectRule[];
565
+ redirects?: {
566
+ useVueRouter?: boolean;
567
+ rules?: RedirectRule[];
568
+ };
556
569
  }
557
570
  type PartialDeep<T> = {
558
571
  [P in keyof T]?: T[P] extends object ? PartialDeep<T[P]> : T[P];
@@ -562,6 +575,10 @@ type PartialDeep<T> = {
562
575
  */
563
576
  interface RuntimeConfig {
564
577
  addons: Record<string, ValaxyAddon>;
578
+ redirects: {
579
+ useVueRouter: boolean;
580
+ redirectRoutes: RouteRecordRaw[];
581
+ };
565
582
  }
566
583
  interface Pkg {
567
584
  name: string;
@@ -604,4 +621,4 @@ type UserSiteConfig = PartialDeep<SiteConfig>;
604
621
  */
605
622
  type UserValaxyConfig<ThemeConfig = DefaultTheme.Config> = PartialDeep<ValaxyConfig<ThemeConfig>>;
606
623
 
607
- export { type Album as A, DefaultTheme as D, type ExcerptType as E, type FuseListItem as F, type PartialDeep as P, type RedirectRule as R, type SocialLink as S, type UserSiteConfig as U, type ValaxyAddon as V, type Post as a, type SiteConfig as b, type RuntimeConfig as c, type Pkg as d, type ValaxyConfig as e, type UserValaxyConfig as f, type Photo as g, type PageFrontMatter as h, type PostFrontMatter as i, type Page as j };
624
+ export { type Album as A, DefaultTheme as D, type ExcerptType as E, type FuseListItem as F, type PartialDeep as P, type RedirectRule as R, type SocialLink as S, type UserSiteConfig as U, type ValaxyAddon as V, type Post as a, type RedirectItem as b, type SiteConfig as c, type RuntimeConfig as d, type Pkg as e, type ValaxyConfig as f, type UserValaxyConfig as g, type Photo as h, type PageFrontMatter as i, type PostFrontMatter as j, type Page as k };
@@ -1,6 +1,7 @@
1
1
  import { ZoomOptions } from 'medium-zoom';
2
2
  import { FuseOptions } from '@vueuse/integrations/useFuse';
3
3
  import { ILazyLoadOptions } from 'vanilla-lazyload';
4
+ import { RouteRecordRaw } from 'vue-router';
4
5
  import { NodeRelations, ImageObject } from '@unhead/schema-org';
5
6
 
6
7
  interface ValaxyAddon<AddonOptions = Record<string, any>> {
@@ -185,6 +186,11 @@ interface PageFrontMatter extends Record<string, any> {
185
186
  * @description:zh-CN 限制代码块的高度,单位是 px
186
187
  */
187
188
  codeHeightLimit?: number;
189
+ /**
190
+ * @description:en-US Source path for client redirection
191
+ * @description:zh-CN 客户端重定向的源路径
192
+ */
193
+ from?: string | string[];
188
194
  }
189
195
  interface PostFrontMatter extends PageFrontMatter {
190
196
  /**
@@ -279,6 +285,10 @@ interface RedirectRule {
279
285
  to: string;
280
286
  from: string | string[];
281
287
  }
288
+ interface RedirectItem {
289
+ from: string;
290
+ to: string;
291
+ }
282
292
  interface SiteConfig {
283
293
  /**
284
294
  * enable auto (light/dark mode)
@@ -552,7 +562,10 @@ interface SiteConfig {
552
562
  * @description:en-US client redirect rules
553
563
  * @description:zh-CN 客户端重定向规则
554
564
  */
555
- redirects?: RedirectRule[];
565
+ redirects?: {
566
+ useVueRouter?: boolean;
567
+ rules?: RedirectRule[];
568
+ };
556
569
  }
557
570
  type PartialDeep<T> = {
558
571
  [P in keyof T]?: T[P] extends object ? PartialDeep<T[P]> : T[P];
@@ -562,6 +575,10 @@ type PartialDeep<T> = {
562
575
  */
563
576
  interface RuntimeConfig {
564
577
  addons: Record<string, ValaxyAddon>;
578
+ redirects: {
579
+ useVueRouter: boolean;
580
+ redirectRoutes: RouteRecordRaw[];
581
+ };
565
582
  }
566
583
  interface Pkg {
567
584
  name: string;
@@ -604,4 +621,4 @@ type UserSiteConfig = PartialDeep<SiteConfig>;
604
621
  */
605
622
  type UserValaxyConfig<ThemeConfig = DefaultTheme.Config> = PartialDeep<ValaxyConfig<ThemeConfig>>;
606
623
 
607
- export { type Album as A, DefaultTheme as D, type ExcerptType as E, type FuseListItem as F, type PartialDeep as P, type RedirectRule as R, type SocialLink as S, type UserSiteConfig as U, type ValaxyAddon as V, type Post as a, type SiteConfig as b, type RuntimeConfig as c, type Pkg as d, type ValaxyConfig as e, type UserValaxyConfig as f, type Photo as g, type PageFrontMatter as h, type PostFrontMatter as i, type Page as j };
624
+ export { type Album as A, DefaultTheme as D, type ExcerptType as E, type FuseListItem as F, type PartialDeep as P, type RedirectRule as R, type SocialLink as S, type UserSiteConfig as U, type ValaxyAddon as V, type Post as a, type RedirectItem as b, type SiteConfig as c, type RuntimeConfig as d, type Pkg as e, type ValaxyConfig as f, type UserValaxyConfig as g, type Photo as h, type PageFrontMatter as i, type PostFrontMatter as j, type Page as k };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkT4SN3XT6cjs = require('../../chunk-T4SN3XT6.cjs');require('../../chunk-FNMRWIFM.cjs');exports.cli = _chunkT4SN3XT6cjs.M; exports.run = _chunkT4SN3XT6cjs.N;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkCBD6N7G5cjs = require('../../chunk-CBD6N7G5.cjs');require('../../chunk-FNMRWIFM.cjs');exports.cli = _chunkCBD6N7G5cjs.M; exports.run = _chunkCBD6N7G5cjs.N;
@@ -1,2 +1,2 @@
1
1
  import {createRequire as __createRequire} from 'module';var require=__createRequire(import.meta.url);
2
- import{M as a,N as b}from"../../chunk-HZ4FMCTT.mjs";import"../../chunk-R4WV6S3O.mjs";export{a as cli,b as run};
2
+ import{M as a,N as b}from"../../chunk-YJCKNZWO.mjs";import"../../chunk-R4WV6S3O.mjs";export{a as cli,b as run};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkT4SN3XT6cjs = require('../chunk-T4SN3XT6.cjs');require('../chunk-FNMRWIFM.cjs');exports.build = _chunkT4SN3XT6cjs.H; exports.cli = _chunkT4SN3XT6cjs.M; exports.createServer = _chunkT4SN3XT6cjs.L; exports.defaultSiteConfig = _chunkT4SN3XT6cjs.k; exports.defaultValaxyConfig = _chunkT4SN3XT6cjs.o; exports.defineAddon = _chunkT4SN3XT6cjs.v; exports.defineConfig = _chunkT4SN3XT6cjs.q; exports.defineSiteConfig = _chunkT4SN3XT6cjs.l; exports.defineTheme = _chunkT4SN3XT6cjs.A; exports.defineUnoSetup = _chunkT4SN3XT6cjs.B; exports.defineValaxyAddon = _chunkT4SN3XT6cjs.u; exports.defineValaxyConfig = _chunkT4SN3XT6cjs.p; exports.defineValaxyTheme = _chunkT4SN3XT6cjs.z; exports.ensurePrefix = _chunkT4SN3XT6cjs.e; exports.generateClientRedirects = _chunkT4SN3XT6cjs.K; exports.getGitTimestamp = _chunkT4SN3XT6cjs.a; exports.getIndexHtml = _chunkT4SN3XT6cjs.G; exports.isExternal = _chunkT4SN3XT6cjs.c; exports.isPath = _chunkT4SN3XT6cjs.g; exports.loadConfig = _chunkT4SN3XT6cjs.i; exports.loadConfigFromFile = _chunkT4SN3XT6cjs.j; exports.mergeValaxyConfig = _chunkT4SN3XT6cjs.s; exports.mergeViteConfigs = _chunkT4SN3XT6cjs.F; exports.postProcessForSSG = _chunkT4SN3XT6cjs.J; exports.processValaxyOptions = _chunkT4SN3XT6cjs.C; exports.resolveAddonConfig = _chunkT4SN3XT6cjs.w; exports.resolveImportPath = _chunkT4SN3XT6cjs.b; exports.resolveOptions = _chunkT4SN3XT6cjs.D; exports.resolveSiteConfig = _chunkT4SN3XT6cjs.n; exports.resolveSiteConfigFromRoot = _chunkT4SN3XT6cjs.m; exports.resolveThemeConfigFromRoot = _chunkT4SN3XT6cjs.x; exports.resolveThemeValaxyConfig = _chunkT4SN3XT6cjs.E; exports.resolveUserThemeConfig = _chunkT4SN3XT6cjs.y; exports.resolveValaxyConfig = _chunkT4SN3XT6cjs.t; exports.resolveValaxyConfigFromRoot = _chunkT4SN3XT6cjs.r; exports.run = _chunkT4SN3XT6cjs.N; exports.slash = _chunkT4SN3XT6cjs.d; exports.ssgBuild = _chunkT4SN3XT6cjs.I; exports.toAtFS = _chunkT4SN3XT6cjs.f; exports.transformObject = _chunkT4SN3XT6cjs.h;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkCBD6N7G5cjs = require('../chunk-CBD6N7G5.cjs');require('../chunk-FNMRWIFM.cjs');exports.build = _chunkCBD6N7G5cjs.H; exports.cli = _chunkCBD6N7G5cjs.M; exports.createServer = _chunkCBD6N7G5cjs.L; exports.defaultSiteConfig = _chunkCBD6N7G5cjs.k; exports.defaultValaxyConfig = _chunkCBD6N7G5cjs.o; exports.defineAddon = _chunkCBD6N7G5cjs.v; exports.defineConfig = _chunkCBD6N7G5cjs.q; exports.defineSiteConfig = _chunkCBD6N7G5cjs.l; exports.defineTheme = _chunkCBD6N7G5cjs.A; exports.defineUnoSetup = _chunkCBD6N7G5cjs.B; exports.defineValaxyAddon = _chunkCBD6N7G5cjs.u; exports.defineValaxyConfig = _chunkCBD6N7G5cjs.p; exports.defineValaxyTheme = _chunkCBD6N7G5cjs.z; exports.ensurePrefix = _chunkCBD6N7G5cjs.e; exports.generateClientRedirects = _chunkCBD6N7G5cjs.K; exports.getGitTimestamp = _chunkCBD6N7G5cjs.a; exports.getIndexHtml = _chunkCBD6N7G5cjs.G; exports.isExternal = _chunkCBD6N7G5cjs.c; exports.isPath = _chunkCBD6N7G5cjs.g; exports.loadConfig = _chunkCBD6N7G5cjs.i; exports.loadConfigFromFile = _chunkCBD6N7G5cjs.j; exports.mergeValaxyConfig = _chunkCBD6N7G5cjs.s; exports.mergeViteConfigs = _chunkCBD6N7G5cjs.F; exports.postProcessForSSG = _chunkCBD6N7G5cjs.J; exports.processValaxyOptions = _chunkCBD6N7G5cjs.C; exports.resolveAddonsConfig = _chunkCBD6N7G5cjs.w; exports.resolveImportPath = _chunkCBD6N7G5cjs.b; exports.resolveOptions = _chunkCBD6N7G5cjs.D; exports.resolveSiteConfig = _chunkCBD6N7G5cjs.n; exports.resolveSiteConfigFromRoot = _chunkCBD6N7G5cjs.m; exports.resolveThemeConfigFromRoot = _chunkCBD6N7G5cjs.x; exports.resolveThemeValaxyConfig = _chunkCBD6N7G5cjs.E; exports.resolveUserThemeConfig = _chunkCBD6N7G5cjs.y; exports.resolveValaxyConfig = _chunkCBD6N7G5cjs.t; exports.resolveValaxyConfigFromRoot = _chunkCBD6N7G5cjs.r; exports.run = _chunkCBD6N7G5cjs.N; exports.slash = _chunkCBD6N7G5cjs.d; exports.ssgBuild = _chunkCBD6N7G5cjs.I; exports.toAtFS = _chunkCBD6N7G5cjs.f; exports.transformObject = _chunkCBD6N7G5cjs.h;
@@ -3,7 +3,7 @@ export { cli, run } from './cli/index.cjs';
3
3
  import * as vite from 'vite';
4
4
  import { UserConfig, InlineConfig } from 'vite';
5
5
  import * as valaxy_types from 'valaxy/types';
6
- import { DefaultTheme, ValaxyConfig, PartialDeep, ValaxyAddon, RuntimeConfig, SiteConfig, UserSiteConfig } from 'valaxy/types';
6
+ import { DefaultTheme, ValaxyConfig, PartialDeep, ValaxyAddon, RuntimeConfig, RedirectItem, SiteConfig, UserSiteConfig } from 'valaxy/types';
7
7
  import Vue from '@vitejs/plugin-vue';
8
8
  import Components from 'unplugin-vue-components/vite';
9
9
  import Layouts from 'vite-plugin-vue-layouts';
@@ -23,11 +23,12 @@ import { TocPluginOptions } from '@mdit-vue/plugin-toc';
23
23
  import { ComponentPluginOptions } from '@mdit-vue/plugin-component';
24
24
  import { Awaitable } from '@antfu/utils';
25
25
  import * as defu from 'defu';
26
- import { P as PartialDeep$1 } from '../config-hKSeaczj.cjs';
26
+ import { P as PartialDeep$1 } from '../config-hM2lXH4J.cjs';
27
27
  import 'yargs';
28
28
  import 'medium-zoom';
29
29
  import '@vueuse/integrations/useFuse';
30
30
  import 'vanilla-lazyload';
31
+ import 'vue-router';
31
32
  import '@unhead/schema-org';
32
33
 
33
34
  declare module 'vite' {
@@ -198,6 +199,10 @@ interface ValaxyExtendConfig {
198
199
  katex: boolean;
199
200
  };
200
201
  vite?: UserConfig;
202
+ /**
203
+ * @vitejs/plugin-vue options
204
+ * @see https://github.com/vitejs/vite-plugin-vue/blob/main/packages/plugin-vue/README.md
205
+ */
201
206
  vue?: Parameters<typeof Vue>[0];
202
207
  components?: Parameters<typeof Components>[0];
203
208
  layouts?: Parameters<typeof Layouts>[0];
@@ -310,6 +315,10 @@ interface ResolvedValaxyOptions<ThemeConfig = DefaultTheme.Config> {
310
315
  * Record<package-name, OptionResolver>
311
316
  */
312
317
  addons: ValaxyAddonResolver[];
318
+ /**
319
+ * Collect redirect rule
320
+ */
321
+ redirects: RedirectItem[];
313
322
  }
314
323
  interface ValaxyServerOptions {
315
324
  onConfigReload?: (newConfig: ValaxyNodeConfig, config: ValaxyNodeConfig, force?: boolean) => void;
@@ -401,7 +410,7 @@ declare function defineValaxyAddon<AddonOptions = object>(addonFunc: (addonOptio
401
410
  setup?: ValaxyAddonResolver['setup'];
402
411
  };
403
412
  declare const defineAddon: typeof defineValaxyAddon;
404
- declare function resolveAddonConfig(addons: ValaxyAddonResolver[], _options?: ResolvedValaxyOptions): Promise<ValaxyNodeConfig>;
413
+ declare function resolveAddonsConfig(addons: ValaxyAddonResolver[], options: ResolvedValaxyOptions): Promise<ValaxyNodeConfig>;
405
414
 
406
415
  declare const defaultSiteConfig: SiteConfig;
407
416
  /**
@@ -469,4 +478,4 @@ declare function isPath(name: string): boolean;
469
478
  */
470
479
  declare function transformObject(obj: any): string;
471
480
 
472
- export { type HookResult, type LoadConfigFromFileOptions, type ResolvedConfig, type ResolvedValaxyOptions, type UnoSetup, type UserInputConfig, type UserValaxyNodeConfig, type ValaxyAddonExport, type ValaxyAddonFn, type ValaxyAddonLike, type ValaxyAddonResolver, type ValaxyAddons, type ValaxyConfigExport, type ValaxyConfigExtendKey, type ValaxyConfigFn, type ValaxyEntryOptions, type ValaxyExtendConfig, type ValaxyHooks, type ValaxyNode, type ValaxyNodeConfig, type ValaxyPickConfig, type ValaxyServerOptions, type ValaxyTheme, build, createServer, defaultSiteConfig, defaultValaxyConfig, defineAddon, defineConfig, defineSiteConfig, defineTheme, defineUnoSetup, defineValaxyAddon, defineValaxyConfig, defineValaxyTheme, ensurePrefix, generateClientRedirects, getGitTimestamp, getIndexHtml, isExternal, isPath, loadConfig, loadConfigFromFile, mergeValaxyConfig, mergeViteConfigs, postProcessForSSG, processValaxyOptions, resolveAddonConfig, resolveImportPath, resolveOptions, resolveSiteConfig, resolveSiteConfigFromRoot, resolveThemeConfigFromRoot, resolveThemeValaxyConfig, resolveUserThemeConfig, resolveValaxyConfig, resolveValaxyConfigFromRoot, slash, ssgBuild, toAtFS, transformObject };
481
+ export { type HookResult, type LoadConfigFromFileOptions, type ResolvedConfig, type ResolvedValaxyOptions, type UnoSetup, type UserInputConfig, type UserValaxyNodeConfig, type ValaxyAddonExport, type ValaxyAddonFn, type ValaxyAddonLike, type ValaxyAddonResolver, type ValaxyAddons, type ValaxyConfigExport, type ValaxyConfigExtendKey, type ValaxyConfigFn, type ValaxyEntryOptions, type ValaxyExtendConfig, type ValaxyHooks, type ValaxyNode, type ValaxyNodeConfig, type ValaxyPickConfig, type ValaxyServerOptions, type ValaxyTheme, build, createServer, defaultSiteConfig, defaultValaxyConfig, defineAddon, defineConfig, defineSiteConfig, defineTheme, defineUnoSetup, defineValaxyAddon, defineValaxyConfig, defineValaxyTheme, ensurePrefix, generateClientRedirects, getGitTimestamp, getIndexHtml, isExternal, isPath, loadConfig, loadConfigFromFile, mergeValaxyConfig, mergeViteConfigs, postProcessForSSG, processValaxyOptions, resolveAddonsConfig, resolveImportPath, resolveOptions, resolveSiteConfig, resolveSiteConfigFromRoot, resolveThemeConfigFromRoot, resolveThemeValaxyConfig, resolveUserThemeConfig, resolveValaxyConfig, resolveValaxyConfigFromRoot, slash, ssgBuild, toAtFS, transformObject };
@@ -3,7 +3,7 @@ export { cli, run } from './cli/index.js';
3
3
  import * as vite from 'vite';
4
4
  import { UserConfig, InlineConfig } from 'vite';
5
5
  import * as valaxy_types from 'valaxy/types';
6
- import { DefaultTheme, ValaxyConfig, PartialDeep, ValaxyAddon, RuntimeConfig, SiteConfig, UserSiteConfig } from 'valaxy/types';
6
+ import { DefaultTheme, ValaxyConfig, PartialDeep, ValaxyAddon, RuntimeConfig, RedirectItem, SiteConfig, UserSiteConfig } from 'valaxy/types';
7
7
  import Vue from '@vitejs/plugin-vue';
8
8
  import Components from 'unplugin-vue-components/vite';
9
9
  import Layouts from 'vite-plugin-vue-layouts';
@@ -23,11 +23,12 @@ import { TocPluginOptions } from '@mdit-vue/plugin-toc';
23
23
  import { ComponentPluginOptions } from '@mdit-vue/plugin-component';
24
24
  import { Awaitable } from '@antfu/utils';
25
25
  import * as defu from 'defu';
26
- import { P as PartialDeep$1 } from '../config-hKSeaczj.js';
26
+ import { P as PartialDeep$1 } from '../config-hM2lXH4J.js';
27
27
  import 'yargs';
28
28
  import 'medium-zoom';
29
29
  import '@vueuse/integrations/useFuse';
30
30
  import 'vanilla-lazyload';
31
+ import 'vue-router';
31
32
  import '@unhead/schema-org';
32
33
 
33
34
  declare module 'vite' {
@@ -198,6 +199,10 @@ interface ValaxyExtendConfig {
198
199
  katex: boolean;
199
200
  };
200
201
  vite?: UserConfig;
202
+ /**
203
+ * @vitejs/plugin-vue options
204
+ * @see https://github.com/vitejs/vite-plugin-vue/blob/main/packages/plugin-vue/README.md
205
+ */
201
206
  vue?: Parameters<typeof Vue>[0];
202
207
  components?: Parameters<typeof Components>[0];
203
208
  layouts?: Parameters<typeof Layouts>[0];
@@ -310,6 +315,10 @@ interface ResolvedValaxyOptions<ThemeConfig = DefaultTheme.Config> {
310
315
  * Record<package-name, OptionResolver>
311
316
  */
312
317
  addons: ValaxyAddonResolver[];
318
+ /**
319
+ * Collect redirect rule
320
+ */
321
+ redirects: RedirectItem[];
313
322
  }
314
323
  interface ValaxyServerOptions {
315
324
  onConfigReload?: (newConfig: ValaxyNodeConfig, config: ValaxyNodeConfig, force?: boolean) => void;
@@ -401,7 +410,7 @@ declare function defineValaxyAddon<AddonOptions = object>(addonFunc: (addonOptio
401
410
  setup?: ValaxyAddonResolver['setup'];
402
411
  };
403
412
  declare const defineAddon: typeof defineValaxyAddon;
404
- declare function resolveAddonConfig(addons: ValaxyAddonResolver[], _options?: ResolvedValaxyOptions): Promise<ValaxyNodeConfig>;
413
+ declare function resolveAddonsConfig(addons: ValaxyAddonResolver[], options: ResolvedValaxyOptions): Promise<ValaxyNodeConfig>;
405
414
 
406
415
  declare const defaultSiteConfig: SiteConfig;
407
416
  /**
@@ -469,4 +478,4 @@ declare function isPath(name: string): boolean;
469
478
  */
470
479
  declare function transformObject(obj: any): string;
471
480
 
472
- export { type HookResult, type LoadConfigFromFileOptions, type ResolvedConfig, type ResolvedValaxyOptions, type UnoSetup, type UserInputConfig, type UserValaxyNodeConfig, type ValaxyAddonExport, type ValaxyAddonFn, type ValaxyAddonLike, type ValaxyAddonResolver, type ValaxyAddons, type ValaxyConfigExport, type ValaxyConfigExtendKey, type ValaxyConfigFn, type ValaxyEntryOptions, type ValaxyExtendConfig, type ValaxyHooks, type ValaxyNode, type ValaxyNodeConfig, type ValaxyPickConfig, type ValaxyServerOptions, type ValaxyTheme, build, createServer, defaultSiteConfig, defaultValaxyConfig, defineAddon, defineConfig, defineSiteConfig, defineTheme, defineUnoSetup, defineValaxyAddon, defineValaxyConfig, defineValaxyTheme, ensurePrefix, generateClientRedirects, getGitTimestamp, getIndexHtml, isExternal, isPath, loadConfig, loadConfigFromFile, mergeValaxyConfig, mergeViteConfigs, postProcessForSSG, processValaxyOptions, resolveAddonConfig, resolveImportPath, resolveOptions, resolveSiteConfig, resolveSiteConfigFromRoot, resolveThemeConfigFromRoot, resolveThemeValaxyConfig, resolveUserThemeConfig, resolveValaxyConfig, resolveValaxyConfigFromRoot, slash, ssgBuild, toAtFS, transformObject };
481
+ export { type HookResult, type LoadConfigFromFileOptions, type ResolvedConfig, type ResolvedValaxyOptions, type UnoSetup, type UserInputConfig, type UserValaxyNodeConfig, type ValaxyAddonExport, type ValaxyAddonFn, type ValaxyAddonLike, type ValaxyAddonResolver, type ValaxyAddons, type ValaxyConfigExport, type ValaxyConfigExtendKey, type ValaxyConfigFn, type ValaxyEntryOptions, type ValaxyExtendConfig, type ValaxyHooks, type ValaxyNode, type ValaxyNodeConfig, type ValaxyPickConfig, type ValaxyServerOptions, type ValaxyTheme, build, createServer, defaultSiteConfig, defaultValaxyConfig, defineAddon, defineConfig, defineSiteConfig, defineTheme, defineUnoSetup, defineValaxyAddon, defineValaxyConfig, defineValaxyTheme, ensurePrefix, generateClientRedirects, getGitTimestamp, getIndexHtml, isExternal, isPath, loadConfig, loadConfigFromFile, mergeValaxyConfig, mergeViteConfigs, postProcessForSSG, processValaxyOptions, resolveAddonsConfig, resolveImportPath, resolveOptions, resolveSiteConfig, resolveSiteConfigFromRoot, resolveThemeConfigFromRoot, resolveThemeValaxyConfig, resolveUserThemeConfig, resolveValaxyConfig, resolveValaxyConfigFromRoot, slash, ssgBuild, toAtFS, transformObject };
@@ -1,2 +1,2 @@
1
1
  import {createRequire as __createRequire} from 'module';var require=__createRequire(import.meta.url);
2
- import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"../chunk-HZ4FMCTT.mjs";import"../chunk-R4WV6S3O.mjs";export{H as build,M as cli,L as createServer,k as defaultSiteConfig,o as defaultValaxyConfig,v as defineAddon,q as defineConfig,l as defineSiteConfig,A as defineTheme,B as defineUnoSetup,u as defineValaxyAddon,p as defineValaxyConfig,z as defineValaxyTheme,e as ensurePrefix,K as generateClientRedirects,a as getGitTimestamp,G as getIndexHtml,c as isExternal,g as isPath,i as loadConfig,j as loadConfigFromFile,s as mergeValaxyConfig,F as mergeViteConfigs,J as postProcessForSSG,C as processValaxyOptions,w as resolveAddonConfig,b as resolveImportPath,D as resolveOptions,n as resolveSiteConfig,m as resolveSiteConfigFromRoot,x as resolveThemeConfigFromRoot,E as resolveThemeValaxyConfig,y as resolveUserThemeConfig,t as resolveValaxyConfig,r as resolveValaxyConfigFromRoot,N as run,d as slash,I as ssgBuild,f as toAtFS,h as transformObject};
2
+ import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"../chunk-YJCKNZWO.mjs";import"../chunk-R4WV6S3O.mjs";export{H as build,M as cli,L as createServer,k as defaultSiteConfig,o as defaultValaxyConfig,v as defineAddon,q as defineConfig,l as defineSiteConfig,A as defineTheme,B as defineUnoSetup,u as defineValaxyAddon,p as defineValaxyConfig,z as defineValaxyTheme,e as ensurePrefix,K as generateClientRedirects,a as getGitTimestamp,G as getIndexHtml,c as isExternal,g as isPath,i as loadConfig,j as loadConfigFromFile,s as mergeValaxyConfig,F as mergeViteConfigs,J as postProcessForSSG,C as processValaxyOptions,w as resolveAddonsConfig,b as resolveImportPath,D as resolveOptions,n as resolveSiteConfig,m as resolveSiteConfigFromRoot,x as resolveThemeConfigFromRoot,E as resolveThemeValaxyConfig,y as resolveUserThemeConfig,t as resolveValaxyConfig,r as resolveValaxyConfigFromRoot,N as run,d as slash,I as ssgBuild,f as toAtFS,h as transformObject};
@@ -1,8 +1,9 @@
1
- import { a as Post } from '../config-hKSeaczj.cjs';
2
- export { A as Album, D as DefaultTheme, E as ExcerptType, F as FuseListItem, j as Page, h as PageFrontMatter, P as PartialDeep, g as Photo, d as Pkg, i as PostFrontMatter, R as RedirectRule, c as RuntimeConfig, b as SiteConfig, S as SocialLink, U as UserSiteConfig, f as UserValaxyConfig, V as ValaxyAddon, e as ValaxyConfig } from '../config-hKSeaczj.cjs';
1
+ import { a as Post } from '../config-hM2lXH4J.cjs';
2
+ export { A as Album, D as DefaultTheme, E as ExcerptType, F as FuseListItem, k as Page, i as PageFrontMatter, P as PartialDeep, h as Photo, e as Pkg, j as PostFrontMatter, b as RedirectItem, R as RedirectRule, d as RuntimeConfig, c as SiteConfig, S as SocialLink, U as UserSiteConfig, g as UserValaxyConfig, V as ValaxyAddon, f as ValaxyConfig } from '../config-hM2lXH4J.cjs';
3
3
  import 'medium-zoom';
4
4
  import '@vueuse/integrations/useFuse';
5
5
  import 'vanilla-lazyload';
6
+ import 'vue-router';
6
7
  import '@unhead/schema-org';
7
8
 
8
9
  type CleanUrlsMode = 'disabled' | 'without-subfolders' | 'with-subfolders';
@@ -1,8 +1,9 @@
1
- import { a as Post } from '../config-hKSeaczj.js';
2
- export { A as Album, D as DefaultTheme, E as ExcerptType, F as FuseListItem, j as Page, h as PageFrontMatter, P as PartialDeep, g as Photo, d as Pkg, i as PostFrontMatter, R as RedirectRule, c as RuntimeConfig, b as SiteConfig, S as SocialLink, U as UserSiteConfig, f as UserValaxyConfig, V as ValaxyAddon, e as ValaxyConfig } from '../config-hKSeaczj.js';
1
+ import { a as Post } from '../config-hM2lXH4J.js';
2
+ export { A as Album, D as DefaultTheme, E as ExcerptType, F as FuseListItem, k as Page, i as PageFrontMatter, P as PartialDeep, h as Photo, e as Pkg, j as PostFrontMatter, b as RedirectItem, R as RedirectRule, d as RuntimeConfig, c as SiteConfig, S as SocialLink, U as UserSiteConfig, g as UserValaxyConfig, V as ValaxyAddon, f as ValaxyConfig } from '../config-hM2lXH4J.js';
3
3
  import 'medium-zoom';
4
4
  import '@vueuse/integrations/useFuse';
5
5
  import 'vanilla-lazyload';
6
+ import 'vue-router';
6
7
  import '@unhead/schema-org';
7
8
 
8
9
  type CleanUrlsMode = 'disabled' | 'without-subfolders' | 'with-subfolders';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "valaxy",
3
3
  "type": "module",
4
- "version": "0.17.3",
4
+ "version": "0.17.5",
5
5
  "description": "📄 Vite & Vue powered static blog generator.",
6
6
  "author": {
7
7
  "email": "me@yunyoujun.cn",
@@ -68,7 +68,7 @@
68
68
  "@unhead/schema-org": "^1.8.10",
69
69
  "@unhead/vue": "^1.8.10",
70
70
  "@vitejs/plugin-vue": "^5.0.3",
71
- "@vue/devtools-api": "^7.0.13",
71
+ "@vue/devtools-api": "^7.0.14",
72
72
  "@vueuse/core": "^10.7.2",
73
73
  "@vueuse/integrations": "^10.7.2",
74
74
  "body-scroll-lock": "4.0.0-beta.0",
@@ -115,12 +115,12 @@
115
115
  "unplugin-vue-router": "^0.7.0",
116
116
  "vanilla-lazyload": "^17.8.5",
117
117
  "vite": "^5.0.12",
118
- "vite-plugin-vue-devtools": "^7.0.13",
118
+ "vite-plugin-vue-devtools": "^7.0.14",
119
119
  "vite-plugin-vue-layouts": "0.11.0",
120
120
  "vite-ssg": "0.23.6",
121
121
  "vite-ssg-sitemap": "0.6.1",
122
122
  "vue": "^3.4.15",
123
- "vue-i18n": "^9.9.0",
123
+ "vue-i18n": "^9.9.1",
124
124
  "vue-router": "^4.2.5",
125
125
  "yargs": "^17.7.2",
126
126
  "@valaxyjs/devtools": "0.0.1"
package/shims.d.ts CHANGED
@@ -60,3 +60,11 @@ declare module 'vue-router' {
60
60
  frontmatter: Post
61
61
  }
62
62
  }
63
+
64
+ declare module '/@valaxyjs/redirects' {
65
+ import type { RouteRecordRaw } from 'vue-router'
66
+
67
+ export const redirectRoutes: RouteRecordRaw[]
68
+
69
+ export const useVueRouter: boolean
70
+ }
package/types/config.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { ZoomOptions } from 'medium-zoom'
2
2
  import type { FuseOptions } from '@vueuse/integrations/useFuse'
3
3
  import type { ILazyLoadOptions } from 'vanilla-lazyload'
4
+ import type { RouteRecordRaw } from 'vue-router'
4
5
  import type { ValaxyAddon } from '../types'
5
6
  import type { DefaultTheme } from './default-theme'
6
7
  import type { PostFrontMatter } from './posts'
@@ -27,6 +28,11 @@ export interface RedirectRule {
27
28
  from: string | string[]
28
29
  }
29
30
 
31
+ export interface RedirectItem {
32
+ from: string
33
+ to: string
34
+ }
35
+
30
36
  // shared with valaxy node and client
31
37
  export interface SiteConfig {
32
38
  /**
@@ -323,7 +329,10 @@ export interface SiteConfig {
323
329
  * @description:en-US client redirect rules
324
330
  * @description:zh-CN 客户端重定向规则
325
331
  */
326
- redirects?: RedirectRule[]
332
+ redirects?: {
333
+ useVueRouter?: boolean
334
+ rules?: RedirectRule[]
335
+ }
327
336
  }
328
337
 
329
338
  export type PartialDeep<T> = {
@@ -335,6 +344,10 @@ export type PartialDeep<T> = {
335
344
  */
336
345
  export interface RuntimeConfig {
337
346
  addons: Record<string, ValaxyAddon>
347
+ redirects: {
348
+ useVueRouter: boolean
349
+ redirectRoutes: RouteRecordRaw[]
350
+ }
338
351
  }
339
352
 
340
353
  export interface Pkg {
package/types/posts.ts CHANGED
@@ -176,6 +176,11 @@ export interface PageFrontMatter extends Record<string, any> {
176
176
  * @description:zh-CN 限制代码块的高度,单位是 px
177
177
  */
178
178
  codeHeightLimit?: number
179
+ /**
180
+ * @description:en-US Source path for client redirection
181
+ * @description:zh-CN 客户端重定向的源路径
182
+ */
183
+ from?: string | string[]
179
184
  }
180
185
 
181
186
  export interface PostFrontMatter extends PageFrontMatter {