vitepress 1.6.0 → 1.6.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.
@@ -94,18 +94,12 @@ function newApp() {
94
94
  }
95
95
  function newRouter() {
96
96
  let isInitialPageLoad = inBrowser;
97
- let initialPath;
98
97
  return createRouter((path) => {
99
98
  let pageFilePath = pathToFile(path);
100
99
  let pageModule = null;
101
100
  if (pageFilePath) {
101
+ // use lean build if this is the initial page load
102
102
  if (isInitialPageLoad) {
103
- initialPath = pageFilePath;
104
- }
105
- // use lean build if this is the initial page load or navigating back
106
- // to the initial loaded path (the static vnodes already adopted the
107
- // static content on that load so no need to re-fetch the page)
108
- if (isInitialPageLoad || initialPath === pageFilePath) {
109
103
  pageFilePath = pageFilePath.replace(/\.js$/, '.lean.js');
110
104
  }
111
105
  if (import.meta.env.DEV) {
@@ -29,7 +29,7 @@ const heroImageSlotExists = inject('hero-image-slot-exists') as Ref<boolean>
29
29
  <div class="main">
30
30
  <slot name="home-hero-info-before" />
31
31
  <slot name="home-hero-info">
32
- <h1>
32
+ <h1 class="heading">
33
33
  <span v-if="name" v-html="name" class="name clip"></span>
34
34
  <span v-if="text" v-html="text" class="text"></span>
35
35
  </h1>
@@ -125,9 +125,14 @@ const heroImageSlotExists = inject('hero-image-slot-exists') as Ref<boolean>
125
125
  }
126
126
  }
127
127
 
128
+ .heading {
129
+ display: flex;
130
+ flex-direction: column;
131
+ }
132
+
128
133
  .name,
129
134
  .text {
130
- display: inline-block;
135
+ width: fit-content;
131
136
  max-width: 392px;
132
137
  letter-spacing: -0.4px;
133
138
  line-height: 40px;
@@ -17188,7 +17188,10 @@ const dynamicRoutesPlugin = async (config) => {
17188
17188
  config.dynamicRoutes.fileToModulesMap[routeFile].add(id);
17189
17189
  let baseContent = fs.readFileSync(routeFile, "utf-8");
17190
17190
  if (content) {
17191
- baseContent = baseContent.replace(/<!--\s*@content\s*-->/, content);
17191
+ baseContent = baseContent.replace(
17192
+ /<!--\s*@content\s*-->/,
17193
+ content.replace(/\$/g, "$$$")
17194
+ );
17192
17195
  }
17193
17196
  return `__VP_PARAMS_START${JSON.stringify(
17194
17197
  params
@@ -44862,7 +44865,7 @@ const webFontsPlugin = (enabled = false) => ({
44862
44865
 
44863
44866
  const themeRE = /\/\.vitepress\/theme\/index\.(m|c)?(j|t)s$/;
44864
44867
  const hashRE = /\.([-\w]+)\.js$/;
44865
- const staticInjectMarkerRE = /\b(const _hoisted_\d+ = \/\*(?:#|@)__PURE__\*\/\s*createStaticVNode)\("(.*)", (\d+)\)/g;
44868
+ const staticInjectMarkerRE = /\bcreateStaticVNode\((?:(".*")|('.*')), (\d+)\)/g;
44866
44869
  const staticStripRE = /['"`]__VP_STATIC_START__[^]*?__VP_STATIC_END__['"`]/g;
44867
44870
  const staticRestoreRE = /__VP_STATIC_(START|END)__/g;
44868
44871
  const scriptClientRE = /<script\b[^>]*client\b[^>]*>([^]*?)<\/script>/;
@@ -45085,10 +45088,11 @@ async function createVitePressPlugin(siteConfig, ssr = false, pageToHashMap, cli
45085
45088
  },
45086
45089
  renderChunk(code, chunk) {
45087
45090
  if (!ssr && isPageChunk(chunk)) {
45088
- code = code.replace(
45089
- staticInjectMarkerRE,
45090
- '$1("__VP_STATIC_START__$2__VP_STATIC_END__", $3)'
45091
- );
45091
+ code = code.replace(staticInjectMarkerRE, (_, str1, str2, flag) => {
45092
+ const str = str1 || str2;
45093
+ const quote = str[0];
45094
+ return `createStaticVNode(${quote}__VP_STATIC_START__${str.slice(1, -1)}__VP_STATIC_END__${quote}, ${flag})`;
45095
+ });
45092
45096
  return code;
45093
45097
  }
45094
45098
  return null;
@@ -49365,7 +49369,7 @@ async function generateSitemap(siteConfig) {
49365
49369
  });
49366
49370
  }
49367
49371
 
49368
- var version = "1.6.0";
49372
+ var version = "1.6.2";
49369
49373
 
49370
49374
  async function renderPage(render, config, page, result, appChunk, cssChunk, assets, pageToHashMap, metadataScript, additionalHeadTags, usedIcons) {
49371
49375
  const routePath = `/${page.replace(/\.md$/, "")}`;
package/dist/node/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as getDefaultExportFromCjs, u as c, n as disposeMdItInstance, v as clearCache, l as init, b as build, o as serve, w as version, q as createServer } from './chunk-BZEQqoFe.js';
1
+ import { t as getDefaultExportFromCjs, u as c, n as disposeMdItInstance, v as clearCache, l as init, b as build, o as serve, w as version, q as createServer } from './chunk-BuJ66qxQ.js';
2
2
  import { createLogger } from 'vite';
3
3
  import 'node:path';
4
4
  import 'node:url';
@@ -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 './chunk-BZEQqoFe.js';
4
- export { S as ScaffoldThemeType, b as build, q as createServer, a as defineConfig, e as defineConfigWithTheme, d as defineLoader, n as disposeMdItInstance, l as init, i as mergeConfig, r as resolveConfig, k as resolvePages, j as resolveSiteData, h as resolveUserConfig, s as scaffold, o as serve } from './chunk-BZEQqoFe.js';
3
+ import { g as glob, c as createMarkdownRenderer, f as fs, m as matter, p as postcssPrefixSelector } from './chunk-BuJ66qxQ.js';
4
+ export { S as ScaffoldThemeType, b as build, q as createServer, a as defineConfig, e as defineConfigWithTheme, d as defineLoader, n as disposeMdItInstance, l as init, i as mergeConfig, r as resolveConfig, k as resolvePages, j as resolveSiteData, h as resolveUserConfig, s as scaffold, o as serve } from './chunk-BuJ66qxQ.js';
5
5
  import path from 'node:path';
6
6
  import 'node:crypto';
7
7
  import 'node:module';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitepress",
3
- "version": "1.6.0",
3
+ "version": "1.6.2",
4
4
  "description": "Vite & Vue powered static site generator",
5
5
  "keywords": [
6
6
  "vite",
@@ -57,12 +57,12 @@
57
57
  "*": "prettier --write --ignore-unknown"
58
58
  },
59
59
  "dependencies": {
60
- "@docsearch/css": "^3.8.2",
61
- "@docsearch/js": "^3.8.2",
62
- "@iconify-json/simple-icons": "^1.2.20",
63
- "@shikijs/core": "^2.0.0",
64
- "@shikijs/transformers": "^2.0.0",
65
- "@shikijs/types": "^2.0.0",
60
+ "@docsearch/css": "^3.8.3",
61
+ "@docsearch/js": "^3.8.3",
62
+ "@iconify-json/simple-icons": "^1.2.21",
63
+ "@shikijs/core": "^2.1.0",
64
+ "@shikijs/transformers": "^2.1.0",
65
+ "@shikijs/types": "^2.1.0",
66
66
  "@types/markdown-it": "^14.1.2",
67
67
  "@vitejs/plugin-vue": "^5.2.1",
68
68
  "@vue/devtools-api": "^7.7.0",
@@ -72,8 +72,8 @@
72
72
  "focus-trap": "^7.6.4",
73
73
  "mark.js": "8.11.1",
74
74
  "minisearch": "^7.1.1",
75
- "shiki": "^2.0.0",
76
- "vite": "^5.4.12",
75
+ "shiki": "^2.1.0",
76
+ "vite": "^5.4.14",
77
77
  "vue": "^3.5.13"
78
78
  },
79
79
  "devDependencies": {
@@ -148,7 +148,7 @@
148
148
  "synckit": "^0.9.2",
149
149
  "tinyglobby": "^0.2.10",
150
150
  "typescript": "^5.7.3",
151
- "vitest": "^3.0.2",
151
+ "vitest": "^3.0.3",
152
152
  "vue-tsc": "^2.2.0",
153
153
  "wait-on": "^8.0.2"
154
154
  },