@rspress/shared 1.18.1 → 1.18.3

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/index.d.ts CHANGED
@@ -341,7 +341,7 @@ interface DocFooter {
341
341
  }
342
342
  interface SocialLink {
343
343
  icon: SocialLinkIcon;
344
- mode: 'link' | 'text' | 'img';
344
+ mode: 'link' | 'text' | 'img' | 'dom';
345
345
  content: string;
346
346
  }
347
347
  type SocialLinkIcon = 'lark' | 'discord' | 'facebook' | 'github' | 'instagram' | 'linkedin' | 'slack' | 'twitter' | 'youtube' | 'wechat' | 'qq' | 'juejin' | 'zhihu' | 'bilibili' | 'weibo' | 'gitlab' | 'X' | {
@@ -624,6 +624,7 @@ interface FrontMatterMeta {
624
624
  outline?: boolean;
625
625
  lineNumbers?: boolean;
626
626
  overviewHeaders?: number;
627
+ titleSuffix?: string;
627
628
  }
628
629
  interface PageData {
629
630
  siteData: SiteData<Config$1>;
@@ -663,6 +664,10 @@ interface SearchHooks {
663
664
  }
664
665
  type LocalSearchOptions = SearchHooks & {
665
666
  mode?: 'local';
667
+ /**
668
+ * Whether to generate separate search index for each version
669
+ */
670
+ versioned?: boolean;
666
671
  };
667
672
  type RemoteSearchIndexInfo = string | {
668
673
  value: string;
package/dist/index.js CHANGED
@@ -1269,8 +1269,7 @@ function normalizeHref(url, cleanUrls = false) {
1269
1269
  return url;
1270
1270
  }
1271
1271
  let { url: cleanUrl2, hash } = parseUrl(decodeURIComponent(url));
1272
- const hasExt = cleanUrl2.split("/").pop()?.includes(".");
1273
- if (!cleanUrls && !cleanUrl2.endsWith(".html") && !hasExt) {
1272
+ if (!cleanUrls && !cleanUrl2.endsWith(".html")) {
1274
1273
  if (cleanUrl2.endsWith("/")) {
1275
1274
  cleanUrl2 += "index.html";
1276
1275
  } else {
@@ -1280,6 +1279,9 @@ function normalizeHref(url, cleanUrls = false) {
1280
1279
  if (cleanUrls && cleanUrl2.endsWith("/")) {
1281
1280
  cleanUrl2 += "index";
1282
1281
  }
1282
+ if (cleanUrls && cleanUrl2.endsWith(".html")) {
1283
+ cleanUrl2 = cleanUrl2.replace(/\.html$/, "");
1284
+ }
1283
1285
  return addLeadingSlash(hash ? `${cleanUrl2}#${hash}` : cleanUrl2);
1284
1286
  }
1285
1287
  function withoutLang(path, langs) {
package/dist/index.mjs CHANGED
@@ -1211,8 +1211,7 @@ function normalizeHref(url, cleanUrls = false) {
1211
1211
  return url;
1212
1212
  }
1213
1213
  let { url: cleanUrl2, hash } = parseUrl(decodeURIComponent(url));
1214
- const hasExt = cleanUrl2.split("/").pop()?.includes(".");
1215
- if (!cleanUrls && !cleanUrl2.endsWith(".html") && !hasExt) {
1214
+ if (!cleanUrls && !cleanUrl2.endsWith(".html")) {
1216
1215
  if (cleanUrl2.endsWith("/")) {
1217
1216
  cleanUrl2 += "index.html";
1218
1217
  } else {
@@ -1222,6 +1221,9 @@ function normalizeHref(url, cleanUrls = false) {
1222
1221
  if (cleanUrls && cleanUrl2.endsWith("/")) {
1223
1222
  cleanUrl2 += "index";
1224
1223
  }
1224
+ if (cleanUrls && cleanUrl2.endsWith(".html")) {
1225
+ cleanUrl2 = cleanUrl2.replace(/\.html$/, "");
1226
+ }
1225
1227
  return addLeadingSlash(hash ? `${cleanUrl2}#${hash}` : cleanUrl2);
1226
1228
  }
1227
1229
  function withoutLang(path, langs) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/shared",
3
- "version": "1.18.1",
3
+ "version": "1.18.3",
4
4
  "types": "./dist/index.d.ts",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -61,7 +61,7 @@
61
61
  "rimraf": "~3.0.2",
62
62
  "ts-node": "^10.9.1",
63
63
  "typescript": "~5.0.4",
64
- "medium-zoom": "1.0.8",
64
+ "medium-zoom": "1.1.0",
65
65
  "@types/fs-extra": "11.0.4"
66
66
  },
67
67
  "sideEffects": [],