vitepress 1.4.0 → 1.4.1
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/dist/client/app/composables/head.js +1 -1
- package/dist/client/app/data.js +10 -8
- package/dist/client/theme-default/components/VPLocalSearchBox.vue +14 -3
- package/dist/client/theme-default/components/VPMenuLink.vue +12 -3
- package/dist/client/theme-default/components/VPNavBarMenuLink.vue +1 -1
- package/dist/client/theme-default/components/VPNavScreenMenuGroupLink.vue +2 -1
- package/dist/client/theme-default/components/VPNavScreenMenuLink.vue +7 -3
- package/dist/node/cli.js +1 -1
- package/dist/node/index.d.ts +1 -1
- package/dist/node/index.js +2 -2
- package/dist/node/{serve-Bvg4Nr_L.js → serve-4DnZ8_Si.js} +66 -46
- package/package.json +8 -8
|
@@ -64,7 +64,7 @@ function createHeadElement([tag, attrs, innerHTML]) {
|
|
|
64
64
|
if (innerHTML) {
|
|
65
65
|
el.innerHTML = innerHTML;
|
|
66
66
|
}
|
|
67
|
-
if (tag === 'script' &&
|
|
67
|
+
if (tag === 'script' && attrs.async == null) {
|
|
68
68
|
// async is true by default for dynamically created scripts
|
|
69
69
|
;
|
|
70
70
|
el.async = false;
|
package/dist/client/app/data.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import siteData from '@siteData';
|
|
2
|
-
import { useDark } from '@vueuse/core';
|
|
2
|
+
import { useDark, usePreferredDark } from '@vueuse/core';
|
|
3
3
|
import { computed, inject, readonly, ref, shallowRef, watch } from 'vue';
|
|
4
4
|
import { APPEARANCE_KEY, createTitle, inBrowser, resolveSiteDataByRoute } from '../shared';
|
|
5
5
|
export const dataSymbol = Symbol();
|
|
@@ -19,13 +19,15 @@ export function initData(route) {
|
|
|
19
19
|
const appearance = site.value.appearance; // fine with reactivity being lost here, config change triggers a restart
|
|
20
20
|
const isDark = appearance === 'force-dark'
|
|
21
21
|
? ref(true)
|
|
22
|
-
: appearance
|
|
23
|
-
?
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
: appearance === 'force-auto'
|
|
23
|
+
? usePreferredDark()
|
|
24
|
+
: appearance
|
|
25
|
+
? useDark({
|
|
26
|
+
storageKey: APPEARANCE_KEY,
|
|
27
|
+
initialValue: () => (appearance === 'dark' ? 'dark' : 'auto'),
|
|
28
|
+
...(typeof appearance === 'object' ? appearance : {})
|
|
29
|
+
})
|
|
30
|
+
: ref(false);
|
|
29
31
|
const hashRef = ref(inBrowser ? location.hash : '');
|
|
30
32
|
if (inBrowser) {
|
|
31
33
|
window.addEventListener('hashchange', () => {
|
|
@@ -440,10 +440,20 @@ function formMarkRegex(terms: Set<string>) {
|
|
|
440
440
|
<input
|
|
441
441
|
ref="searchInput"
|
|
442
442
|
v-model="filterText"
|
|
443
|
-
:
|
|
444
|
-
|
|
443
|
+
:aria-activedescendant="selectedIndex > -1 ? ('localsearch-item-' + selectedIndex) : undefined"
|
|
444
|
+
aria-autocomplete="both"
|
|
445
|
+
:aria-controls="results?.length ? 'localsearch-list' : undefined"
|
|
445
446
|
aria-labelledby="localsearch-label"
|
|
447
|
+
autocapitalize="off"
|
|
448
|
+
autocomplete="off"
|
|
449
|
+
autocorrect="off"
|
|
446
450
|
class="search-input"
|
|
451
|
+
id="localsearch-input"
|
|
452
|
+
enterkeyhint="go"
|
|
453
|
+
maxlength="64"
|
|
454
|
+
:placeholder="buttonText"
|
|
455
|
+
spellcheck="false"
|
|
456
|
+
type="search"
|
|
447
457
|
/>
|
|
448
458
|
<div class="search-actions">
|
|
449
459
|
<button
|
|
@@ -482,8 +492,9 @@ function formMarkRegex(terms: Set<string>) {
|
|
|
482
492
|
<li
|
|
483
493
|
v-for="(p, index) in results"
|
|
484
494
|
:key="p.id"
|
|
485
|
-
|
|
495
|
+
:id="'localsearch-item-' + index"
|
|
486
496
|
:aria-selected="selectedIndex === index ? 'true' : 'false'"
|
|
497
|
+
role="option"
|
|
487
498
|
>
|
|
488
499
|
<a
|
|
489
500
|
:href="p.id"
|
|
@@ -14,12 +14,19 @@ const { page } = useData()
|
|
|
14
14
|
<template>
|
|
15
15
|
<div class="VPMenuLink">
|
|
16
16
|
<VPLink
|
|
17
|
-
:class="{
|
|
17
|
+
:class="{
|
|
18
|
+
active: isActive(
|
|
19
|
+
page.relativePath,
|
|
20
|
+
item.activeMatch || item.link,
|
|
21
|
+
!!item.activeMatch
|
|
22
|
+
)
|
|
23
|
+
}"
|
|
18
24
|
:href="item.link"
|
|
19
25
|
:target="item.target"
|
|
20
26
|
:rel="item.rel"
|
|
27
|
+
:no-icon="item.noIcon"
|
|
21
28
|
>
|
|
22
|
-
|
|
29
|
+
<span v-html="item.text"></span>
|
|
23
30
|
</VPLink>
|
|
24
31
|
</div>
|
|
25
32
|
</template>
|
|
@@ -40,7 +47,9 @@ const { page } = useData()
|
|
|
40
47
|
font-weight: 500;
|
|
41
48
|
color: var(--vp-c-text-1);
|
|
42
49
|
white-space: nowrap;
|
|
43
|
-
transition:
|
|
50
|
+
transition:
|
|
51
|
+
background-color 0.25s,
|
|
52
|
+
color 0.25s;
|
|
44
53
|
}
|
|
45
54
|
|
|
46
55
|
.link:hover {
|
|
@@ -16,9 +16,10 @@ const closeScreen = inject('close-screen') as () => void
|
|
|
16
16
|
:href="item.link"
|
|
17
17
|
:target="item.target"
|
|
18
18
|
:rel="item.rel"
|
|
19
|
+
:no-icon="item.noIcon"
|
|
19
20
|
@click="closeScreen"
|
|
20
21
|
>
|
|
21
|
-
|
|
22
|
+
<span v-html="item.text"></span>
|
|
22
23
|
</VPLink>
|
|
23
24
|
</template>
|
|
24
25
|
|
|
@@ -16,9 +16,11 @@ const closeScreen = inject('close-screen') as () => void
|
|
|
16
16
|
:href="item.link"
|
|
17
17
|
:target="item.target"
|
|
18
18
|
:rel="item.rel"
|
|
19
|
+
:no-icon="item.noIcon"
|
|
19
20
|
@click="closeScreen"
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
>
|
|
22
|
+
<span v-html="item.text"></span>
|
|
23
|
+
</VPLink>
|
|
22
24
|
</template>
|
|
23
25
|
|
|
24
26
|
<style scoped>
|
|
@@ -30,7 +32,9 @@ const closeScreen = inject('close-screen') as () => void
|
|
|
30
32
|
font-size: 14px;
|
|
31
33
|
font-weight: 500;
|
|
32
34
|
color: var(--vp-c-text-1);
|
|
33
|
-
transition:
|
|
35
|
+
transition:
|
|
36
|
+
border-color 0.25s,
|
|
37
|
+
color 0.25s;
|
|
34
38
|
}
|
|
35
39
|
|
|
36
40
|
.VPNavScreenMenuLink:hover {
|
package/dist/node/cli.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { q as getDefaultExportFromCjs, t as c, u as clearCache, l as init, b as build, n as serve, v as version, o as createServer } from './serve-
|
|
1
|
+
import { q as getDefaultExportFromCjs, t as c, u as clearCache, l as init, b as build, n as serve, v as version, o as createServer } from './serve-4DnZ8_Si.js';
|
|
2
2
|
import { createLogger } from 'vite';
|
|
3
3
|
import 'path';
|
|
4
4
|
import 'shiki';
|
package/dist/node/index.d.ts
CHANGED
|
@@ -2304,7 +2304,7 @@ interface UserConfig<ThemeConfig = any> extends LocaleSpecificConfig<ThemeConfig
|
|
|
2304
2304
|
*
|
|
2305
2305
|
* source -> destination
|
|
2306
2306
|
*/
|
|
2307
|
-
rewrites?: Record<string, string
|
|
2307
|
+
rewrites?: Record<string, string> | ((id: string) => string);
|
|
2308
2308
|
/**
|
|
2309
2309
|
* @experimental
|
|
2310
2310
|
*/
|
package/dist/node/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { normalizePath } from 'vite';
|
|
2
2
|
export { loadEnv } from 'vite';
|
|
3
|
-
import { g as glob, c as createMarkdownRenderer, f as fs, m as matter, p as postcssPrefixSelector } from './serve-
|
|
4
|
-
export { S as ScaffoldThemeType, b as build, o as createServer, a as defineConfig, e as defineConfigWithTheme, d as defineLoader, l as init, i as mergeConfig, r as resolveConfig, k as resolvePages, j as resolveSiteData, h as resolveUserConfig, s as scaffold, n as serve } from './serve-
|
|
3
|
+
import { g as glob, c as createMarkdownRenderer, f as fs, m as matter, p as postcssPrefixSelector } from './serve-4DnZ8_Si.js';
|
|
4
|
+
export { S as ScaffoldThemeType, b as build, o as createServer, a as defineConfig, e as defineConfigWithTheme, d as defineLoader, l as init, i as mergeConfig, r as resolveConfig, k as resolvePages, j as resolveSiteData, h as resolveUserConfig, s as scaffold, n as serve } from './serve-4DnZ8_Si.js';
|
|
5
5
|
import path from 'path';
|
|
6
6
|
import 'crypto';
|
|
7
7
|
import 'module';
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { createHash } from 'crypto';
|
|
2
2
|
import { createRequire } from 'module';
|
|
3
|
-
import path$1, { resolve as resolve$1, parse as parse$4, basename, join, posix as posix$2, dirname
|
|
4
|
-
import path$2, { win32, posix as posix$1 } from 'node:path';
|
|
3
|
+
import path$1, { resolve as resolve$1, parse as parse$4, basename, join, posix as posix$2, dirname } from 'path';
|
|
4
|
+
import path$2, { win32, posix as posix$1, resolve as resolve$2, normalize as normalize$3, join as join$1 } from 'node:path';
|
|
5
5
|
import process$2, { stdin, stdout } from 'node:process';
|
|
6
6
|
import { lstat as lstat$4, readdir as readdir$3, readlink, realpath } from 'node:fs/promises';
|
|
7
7
|
import { fileURLToPath } from 'node:url';
|
|
8
8
|
import * as fs$2 from 'node:fs';
|
|
9
|
-
import fs__default
|
|
10
|
-
import
|
|
11
|
-
import fs__default, { realpathSync as realpathSync$1, lstatSync, readdir as readdir$2, readdirSync as readdirSync$1, readlinkSync, unlinkSync, rmdirSync, chmodSync, statSync, renameSync, rmSync } from 'fs';
|
|
9
|
+
import fs__default from 'node:fs';
|
|
10
|
+
import fs$3, { realpathSync as realpathSync$1, lstatSync, readdir as readdir$2, readdirSync as readdirSync$1, readlinkSync, unlinkSync, rmdirSync, chmodSync, statSync, renameSync, rmSync } from 'fs';
|
|
12
11
|
import { EventEmitter } from 'node:events';
|
|
13
12
|
import Stream from 'node:stream';
|
|
14
13
|
import { StringDecoder } from 'node:string_decoder';
|
|
@@ -630,7 +629,7 @@ var hasRequiredGracefulFs;
|
|
|
630
629
|
function requireGracefulFs () {
|
|
631
630
|
if (hasRequiredGracefulFs) return gracefulFs;
|
|
632
631
|
hasRequiredGracefulFs = 1;
|
|
633
|
-
var fs =
|
|
632
|
+
var fs = fs$3;
|
|
634
633
|
var polyfills = requirePolyfills();
|
|
635
634
|
var legacy = requireLegacyStreams();
|
|
636
635
|
var clone = requireClone();
|
|
@@ -2420,7 +2419,7 @@ function requireJsonfile$1 () {
|
|
|
2420
2419
|
try {
|
|
2421
2420
|
_fs = requireGracefulFs();
|
|
2422
2421
|
} catch (_) {
|
|
2423
|
-
_fs =
|
|
2422
|
+
_fs = fs$3;
|
|
2424
2423
|
}
|
|
2425
2424
|
const universalify = requireUniversalify();
|
|
2426
2425
|
const { stringify, stripBom } = requireUtils$7();
|
|
@@ -2982,7 +2981,7 @@ function findUpSync(name, {
|
|
|
2982
2981
|
const filePath = path$2.isAbsolute(name) ? name : path$2.join(directory, name);
|
|
2983
2982
|
|
|
2984
2983
|
try {
|
|
2985
|
-
const stats = fs__default
|
|
2984
|
+
const stats = fs__default.statSync(filePath, {throwIfNoEntry: false});
|
|
2986
2985
|
if ((type === 'file' && stats?.isFile()) || (type === 'directory' && stats?.isDirectory())) {
|
|
2987
2986
|
return filePath;
|
|
2988
2987
|
}
|
|
@@ -10986,15 +10985,15 @@ const readdirSync = (path) => readdirSync$1(path, { withFileTypes: true });
|
|
|
10986
10985
|
// than something like:
|
|
10987
10986
|
// const makeCb = (res, rej) => (er, ...d) => er ? rej(er) : res(...d)
|
|
10988
10987
|
// which would be a bit cleaner.
|
|
10989
|
-
const chmod$2 = (path, mode) => new Promise((res, rej) =>
|
|
10990
|
-
const mkdir = (path, options) => new Promise((res, rej) =>
|
|
10991
|
-
const readdir$1 = (path) => new Promise((res, rej) =>
|
|
10992
|
-
const rename$1 = (oldPath, newPath) => new Promise((res, rej) =>
|
|
10993
|
-
const rm$1 = (path, options) => new Promise((res, rej) =>
|
|
10994
|
-
const rmdir$3 = (path) => new Promise((res, rej) =>
|
|
10995
|
-
const stat$1 = (path) => new Promise((res, rej) =>
|
|
10996
|
-
const lstat$3 = (path) => new Promise((res, rej) =>
|
|
10997
|
-
const unlink$3 = (path) => new Promise((res, rej) =>
|
|
10988
|
+
const chmod$2 = (path, mode) => new Promise((res, rej) => fs$3.chmod(path, mode, (er, ...d) => (er ? rej(er) : res(...d))));
|
|
10989
|
+
const mkdir = (path, options) => new Promise((res, rej) => fs$3.mkdir(path, options, (er, made) => (er ? rej(er) : res(made))));
|
|
10990
|
+
const readdir$1 = (path) => new Promise((res, rej) => fs$3.readdir(path, { withFileTypes: true }, (er, data) => er ? rej(er) : res(data)));
|
|
10991
|
+
const rename$1 = (oldPath, newPath) => new Promise((res, rej) => fs$3.rename(oldPath, newPath, (er, ...d) => er ? rej(er) : res(...d)));
|
|
10992
|
+
const rm$1 = (path, options) => new Promise((res, rej) => fs$3.rm(path, options, (er, ...d) => (er ? rej(er) : res(...d))));
|
|
10993
|
+
const rmdir$3 = (path) => new Promise((res, rej) => fs$3.rmdir(path, (er, ...d) => (er ? rej(er) : res(...d))));
|
|
10994
|
+
const stat$1 = (path) => new Promise((res, rej) => fs$3.stat(path, (er, data) => (er ? rej(er) : res(data))));
|
|
10995
|
+
const lstat$3 = (path) => new Promise((res, rej) => fs$3.lstat(path, (er, data) => (er ? rej(er) : res(data))));
|
|
10996
|
+
const unlink$3 = (path) => new Promise((res, rej) => fs$3.unlink(path, (er, ...d) => (er ? rej(er) : res(...d))));
|
|
10998
10997
|
const promises = {
|
|
10999
10998
|
chmod: chmod$2,
|
|
11000
10999
|
mkdir,
|
|
@@ -13214,7 +13213,7 @@ function requireResolveSymlink () {
|
|
|
13214
13213
|
};
|
|
13215
13214
|
Object.defineProperty(resolveSymlink, "__esModule", { value: true });
|
|
13216
13215
|
resolveSymlink.build = void 0;
|
|
13217
|
-
const fs_1 = __importDefault(
|
|
13216
|
+
const fs_1 = __importDefault(fs$3);
|
|
13218
13217
|
const resolveSymlinksAsync = function (path, state, callback) {
|
|
13219
13218
|
const { queue, options: { suppressErrors }, } = state;
|
|
13220
13219
|
queue.enqueue();
|
|
@@ -13353,7 +13352,7 @@ function requireWalkDirectory () {
|
|
|
13353
13352
|
};
|
|
13354
13353
|
Object.defineProperty(walkDirectory, "__esModule", { value: true });
|
|
13355
13354
|
walkDirectory.build = void 0;
|
|
13356
|
-
const fs_1 = __importDefault(
|
|
13355
|
+
const fs_1 = __importDefault(fs$3);
|
|
13357
13356
|
const readdirOpts = { withFileTypes: true };
|
|
13358
13357
|
const walkAsync = (state, directoryPath, currentDepth, callback) => {
|
|
13359
13358
|
state.queue.enqueue();
|
|
@@ -16553,21 +16552,33 @@ function pathToRegexp(path, keys, options) {
|
|
|
16553
16552
|
}
|
|
16554
16553
|
|
|
16555
16554
|
function resolveRewrites(pages, userRewrites) {
|
|
16556
|
-
const rewriteRules = Object.entries(userRewrites || {}).map(([from, to]) => ({
|
|
16557
|
-
toPath: compile$1(`/${to}`, { validate: false }),
|
|
16558
|
-
matchUrl: match(from.startsWith("^") ? new RegExp(from) : from)
|
|
16559
|
-
}));
|
|
16560
16555
|
const pageToRewrite = {};
|
|
16561
16556
|
const rewriteToPage = {};
|
|
16562
|
-
if (
|
|
16557
|
+
if (typeof userRewrites === "function") {
|
|
16563
16558
|
for (const page of pages) {
|
|
16564
|
-
|
|
16565
|
-
|
|
16566
|
-
|
|
16567
|
-
|
|
16568
|
-
|
|
16569
|
-
|
|
16570
|
-
|
|
16559
|
+
const dest = userRewrites(page);
|
|
16560
|
+
if (dest && dest !== page) {
|
|
16561
|
+
pageToRewrite[page] = dest;
|
|
16562
|
+
rewriteToPage[dest] = page;
|
|
16563
|
+
}
|
|
16564
|
+
}
|
|
16565
|
+
} else if (typeof userRewrites === "object") {
|
|
16566
|
+
const rewriteRules = Object.entries(userRewrites || {}).map(
|
|
16567
|
+
([from, to]) => ({
|
|
16568
|
+
toPath: compile$1(`/${to}`, { validate: false }),
|
|
16569
|
+
matchUrl: match(from.startsWith("^") ? new RegExp(from) : from)
|
|
16570
|
+
})
|
|
16571
|
+
);
|
|
16572
|
+
if (rewriteRules.length) {
|
|
16573
|
+
for (const page of pages) {
|
|
16574
|
+
for (const { matchUrl, toPath } of rewriteRules) {
|
|
16575
|
+
const res = matchUrl(page);
|
|
16576
|
+
if (res) {
|
|
16577
|
+
const dest = toPath(res.params).slice(1);
|
|
16578
|
+
pageToRewrite[page] = dest;
|
|
16579
|
+
rewriteToPage[dest] = page;
|
|
16580
|
+
break;
|
|
16581
|
+
}
|
|
16571
16582
|
}
|
|
16572
16583
|
}
|
|
16573
16584
|
}
|
|
@@ -22345,7 +22356,7 @@ function requireGrayMatter () {
|
|
|
22345
22356
|
if (hasRequiredGrayMatter) return grayMatter;
|
|
22346
22357
|
hasRequiredGrayMatter = 1;
|
|
22347
22358
|
|
|
22348
|
-
const fs =
|
|
22359
|
+
const fs = fs$3;
|
|
22349
22360
|
const sections = requireSectionMatter();
|
|
22350
22361
|
const defaults = requireDefaults();
|
|
22351
22362
|
const stringify = requireStringify$1();
|
|
@@ -34959,7 +34970,7 @@ function requireWindows () {
|
|
|
34959
34970
|
windows = isexe;
|
|
34960
34971
|
isexe.sync = sync;
|
|
34961
34972
|
|
|
34962
|
-
var fs =
|
|
34973
|
+
var fs = fs$3;
|
|
34963
34974
|
|
|
34964
34975
|
function checkPathExt (path, options) {
|
|
34965
34976
|
var pathext = options.pathExt !== undefined ?
|
|
@@ -35010,7 +35021,7 @@ function requireMode () {
|
|
|
35010
35021
|
mode = isexe;
|
|
35011
35022
|
isexe.sync = sync;
|
|
35012
35023
|
|
|
35013
|
-
var fs =
|
|
35024
|
+
var fs = fs$3;
|
|
35014
35025
|
|
|
35015
35026
|
function isexe (path, options, cb) {
|
|
35016
35027
|
fs.stat(path, function (er, stat) {
|
|
@@ -35433,7 +35444,7 @@ function requireReadShebang () {
|
|
|
35433
35444
|
if (hasRequiredReadShebang) return readShebang_1;
|
|
35434
35445
|
hasRequiredReadShebang = 1;
|
|
35435
35446
|
|
|
35436
|
-
const fs =
|
|
35447
|
+
const fs = fs$3;
|
|
35437
35448
|
const shebangCommand = requireShebangCommand();
|
|
35438
35449
|
|
|
35439
35450
|
function readShebang(command) {
|
|
@@ -35760,13 +35771,13 @@ async function createMarkdownToVueRenderFn(srcDir, options = {}, pages, isBuild
|
|
|
35760
35771
|
const dynamicRoutes = new Map(
|
|
35761
35772
|
siteConfig?.dynamicRoutes?.routes.map((r) => [
|
|
35762
35773
|
r.fullPath,
|
|
35763
|
-
path$1.join(srcDir, r.route)
|
|
35774
|
+
slash(path$1.join(srcDir, r.route))
|
|
35764
35775
|
]) || []
|
|
35765
35776
|
);
|
|
35766
35777
|
const rewrites = new Map(
|
|
35767
35778
|
Object.entries(siteConfig?.rewrites.map || {}).map(([key, value]) => [
|
|
35768
|
-
path$1.join(srcDir, key),
|
|
35769
|
-
path$1.join(srcDir, value)
|
|
35779
|
+
slash(path$1.join(srcDir, key)),
|
|
35780
|
+
slash(path$1.join(srcDir, value))
|
|
35770
35781
|
]) || []
|
|
35771
35782
|
);
|
|
35772
35783
|
return async (src, file, publicDir) => {
|
|
@@ -45207,7 +45218,7 @@ function requireUtils () {
|
|
|
45207
45218
|
* Copyright(c) 2011 Eugene Kalinin
|
|
45208
45219
|
* MIT Licensed
|
|
45209
45220
|
*/
|
|
45210
|
-
const fs_1 =
|
|
45221
|
+
const fs_1 = fs$3;
|
|
45211
45222
|
const stream_1 = require$$0$2;
|
|
45212
45223
|
const readline_1 = require$$2$1;
|
|
45213
45224
|
const url_1 = require$$3;
|
|
@@ -48305,7 +48316,7 @@ function requireSitemapSimple () {
|
|
|
48305
48316
|
const sitemap_stream_1 = requireSitemapStream();
|
|
48306
48317
|
const utils_1 = requireUtils();
|
|
48307
48318
|
const zlib_1 = require$$3$1;
|
|
48308
|
-
const fs_1 =
|
|
48319
|
+
const fs_1 = fs$3;
|
|
48309
48320
|
const path_1 = path$1;
|
|
48310
48321
|
const stream_1 = require$$0$2;
|
|
48311
48322
|
const util_1 = require$$0$3;
|
|
@@ -48497,7 +48508,7 @@ async function generateSitemap(siteConfig) {
|
|
|
48497
48508
|
});
|
|
48498
48509
|
}
|
|
48499
48510
|
|
|
48500
|
-
var version = "1.4.
|
|
48511
|
+
var version = "1.4.1";
|
|
48501
48512
|
|
|
48502
48513
|
async function renderPage(render, config, page, result, appChunk, cssChunk, assets, pageToHashMap, metadataScript, additionalHeadTags) {
|
|
48503
48514
|
const routePath = `/${page.replace(/\.md$/, "")}`;
|
|
@@ -51227,6 +51238,15 @@ function requirePostcssPrefixSelector () {
|
|
|
51227
51238
|
);
|
|
51228
51239
|
}
|
|
51229
51240
|
|
|
51241
|
+
// replace :root, body, html with the prefix
|
|
51242
|
+
if ([':root', 'body', 'html'].some(globalSel => selector.startsWith(globalSel))) {
|
|
51243
|
+
if (options.skipGlobalSelectors) {
|
|
51244
|
+
return selector;
|
|
51245
|
+
}
|
|
51246
|
+
|
|
51247
|
+
return selector.replace(/(html\s+body|:root\s+body|html|:root|body)/gm, prefix);
|
|
51248
|
+
}
|
|
51249
|
+
|
|
51230
51250
|
return prefixWithSpace + selector;
|
|
51231
51251
|
});
|
|
51232
51252
|
}
|
|
@@ -52096,9 +52116,9 @@ function viaLocal(dir, isEtag, uri, extns) {
|
|
|
52096
52116
|
let i=0, arr=toAssume(uri, extns);
|
|
52097
52117
|
let abs, stats, name, headers;
|
|
52098
52118
|
for (; i < arr.length; i++) {
|
|
52099
|
-
abs = normalize$3(join(dir, name=arr[i]));
|
|
52100
|
-
if (abs.startsWith(dir) && fs$
|
|
52101
|
-
stats = fs$
|
|
52119
|
+
abs = normalize$3(join$1(dir, name=arr[i]));
|
|
52120
|
+
if (abs.startsWith(dir) && fs$2.existsSync(abs)) {
|
|
52121
|
+
stats = fs$2.statSync(abs);
|
|
52102
52122
|
if (stats.isDirectory()) continue;
|
|
52103
52123
|
headers = toHeaders(name, stats, isEtag);
|
|
52104
52124
|
headers['Cache-Control'] = isEtag ? 'no-cache' : 'no-store';
|
|
@@ -52146,7 +52166,7 @@ function send(req, res, file, stats, headers) {
|
|
|
52146
52166
|
}
|
|
52147
52167
|
|
|
52148
52168
|
res.writeHead(code, headers);
|
|
52149
|
-
fs$
|
|
52169
|
+
fs$2.createReadStream(file, opts).pipe(res);
|
|
52150
52170
|
}
|
|
52151
52171
|
|
|
52152
52172
|
const ENCODING = {
|
|
@@ -52173,7 +52193,7 @@ function toHeaders(name, stats, isEtag) {
|
|
|
52173
52193
|
}
|
|
52174
52194
|
|
|
52175
52195
|
function sirv (dir, opts={}) {
|
|
52176
|
-
dir = resolve$
|
|
52196
|
+
dir = resolve$2(dir || '.');
|
|
52177
52197
|
|
|
52178
52198
|
let isNotFound = opts.onNoMatch || is404;
|
|
52179
52199
|
let setHeaders = opts.setHeaders || noop;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitepress",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "Vite & Vue powered static site generator",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vite",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@types/markdown-it": "^14.1.2",
|
|
69
69
|
"@vitejs/plugin-vue": "^5.1.4",
|
|
70
70
|
"@vue/devtools-api": "^7.4.6",
|
|
71
|
-
"@vue/shared": "^3.5.
|
|
71
|
+
"@vue/shared": "^3.5.12",
|
|
72
72
|
"@vueuse/core": "^11.1.0",
|
|
73
73
|
"@vueuse/integrations": "^11.1.0",
|
|
74
74
|
"focus-trap": "^7.6.0",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"minisearch": "^7.1.0",
|
|
77
77
|
"shiki": "^1.22.0",
|
|
78
78
|
"vite": "^5.4.8",
|
|
79
|
-
"vue": "^3.5.
|
|
79
|
+
"vue": "^3.5.12"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
82
|
"@clack/prompts": "^0.7.0",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"@types/markdown-it-emoji": "^3.0.1",
|
|
104
104
|
"@types/micromatch": "^4.0.9",
|
|
105
105
|
"@types/minimist": "^1.2.5",
|
|
106
|
-
"@types/node": "^22.7.
|
|
106
|
+
"@types/node": "^22.7.5",
|
|
107
107
|
"@types/postcss-prefix-selector": "^1.16.3",
|
|
108
108
|
"@types/prompts": "^2.4.9",
|
|
109
109
|
"chokidar": "^3.6.0",
|
|
@@ -132,9 +132,9 @@
|
|
|
132
132
|
"path-to-regexp": "^6.3.0",
|
|
133
133
|
"picocolors": "^1.1.0",
|
|
134
134
|
"pkg-dir": "^8.0.0",
|
|
135
|
-
"playwright-chromium": "^1.
|
|
135
|
+
"playwright-chromium": "^1.48.0",
|
|
136
136
|
"polka": "^1.0.0-next.28",
|
|
137
|
-
"postcss-prefix-selector": "^2.
|
|
137
|
+
"postcss-prefix-selector": "^2.1.0",
|
|
138
138
|
"prettier": "^3.3.3",
|
|
139
139
|
"prompts": "^2.4.2",
|
|
140
140
|
"punycode": "^2.3.1",
|
|
@@ -144,11 +144,11 @@
|
|
|
144
144
|
"rollup-plugin-esbuild": "^6.1.1",
|
|
145
145
|
"semver": "^7.6.3",
|
|
146
146
|
"simple-git-hooks": "^2.11.1",
|
|
147
|
-
"sirv": "^
|
|
147
|
+
"sirv": "^3.0.0",
|
|
148
148
|
"sitemap": "^8.0.0",
|
|
149
149
|
"supports-color": "^9.4.0",
|
|
150
150
|
"tinyglobby": "^0.2.9",
|
|
151
|
-
"typescript": "^5.6.
|
|
151
|
+
"typescript": "^5.6.3",
|
|
152
152
|
"vitest": "^2.1.2",
|
|
153
153
|
"vue-tsc": "^2.1.6",
|
|
154
154
|
"wait-on": "^8.0.1"
|