themekit-js 1.503.1321 → 1.503.1604

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.
@@ -38,14 +38,17 @@ const VitePressApp = defineComponent({
38
38
  //@seedunk-theme
39
39
  document.documentElement.setAttribute("theme", themeName.value);
40
40
  let links = [];
41
- //let scripts=[]
41
+ // links.push("dist/videojs/videojs.css");
42
+ let scripts = [];
43
+ // scripts.push("dist/videojs/videojs.js");
44
+ // scripts.push("dist/videojs/videojs-contrib-hls.js");
42
45
  if (themeName.value == "changzhou") {
43
46
  links.push("bootstrap3/dist/css/bootstrap.min.css");
44
47
  links.push("changzhou/dist/css/style.css");
45
48
  }
46
49
  for (var linkHref in links) {
47
50
  const link = document.createElement('link');
48
- link.href = base.value + '.themekit/assets/' + links[linkHref];
51
+ link.href = base.value + '.themekit/' + links[linkHref];
49
52
  link.rel = "stylesheet";
50
53
  document.head.appendChild(link);
51
54
  }
@@ -61,14 +64,12 @@ const VitePressApp = defineComponent({
61
64
  }
62
65
  });
63
66
  }
64
- /*
65
- for(var scriptSrc in scripts){
66
- const script = document.createElement('script');
67
- script.src = base.value +'.themekit/assets/'+scripts[scriptSrc];
68
- script.type="text/javascript";
69
- document.body.appendChild(script);
70
- }
71
- */
67
+ for (var scriptSrc in scripts) {
68
+ const script = document.createElement('script');
69
+ script.src = base.value + '.themekit/' + scripts[scriptSrc];
70
+ script.type = "text/javascript";
71
+ document.body.appendChild(script);
72
+ }
72
73
  });
73
74
  });
74
75
  if (import.meta.env.PROD && site.value.router.prefetchLinks) {
package/dist/node/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as getDefaultExportFromCjs, q as c, t as clearCache, n as init, b as build, o as serve, v as version, p as createServer } from './serve-maOk-CtX.js';
1
+ import { a as getDefaultExportFromCjs, q as c, t as clearCache, n as init, b as build, o as serve, v as version, p as createServer } from './serve-BtiNO0w6.js';
2
2
  import { createLogger } from 'vite';
3
3
  import 'path';
4
4
  import 'markdown-it';
@@ -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, a as getDefaultExportFromCjs } from './serve-maOk-CtX.js';
4
- export { S as ScaffoldThemeType, b as build, p as createServer, e as defineConfig, h as defineConfigWithTheme, d as defineLoader, n as init, j as mergeConfig, r as resolveConfig, l as resolvePages, k as resolveSiteData, i as resolveUserConfig, s as scaffold, o as serve } from './serve-maOk-CtX.js';
3
+ import { g as glob, c as createMarkdownRenderer, f as fs, m as matter, a as getDefaultExportFromCjs } from './serve-BtiNO0w6.js';
4
+ export { S as ScaffoldThemeType, b as build, p as createServer, e as defineConfig, h as defineConfigWithTheme, d as defineLoader, n as init, j as mergeConfig, r as resolveConfig, l as resolvePages, k as resolveSiteData, i as resolveUserConfig, s as scaffold, o as serve } from './serve-BtiNO0w6.js';
5
5
  import path from 'path';
6
6
  import 'crypto';
7
7
  import 'module';
@@ -28857,6 +28857,12 @@ const imagePlugin = (md, { lazyLoading } = {}, base) => {
28857
28857
  let match;
28858
28858
  while ((match = pattern.exec(url == null ? "" : url)) !== null) {
28859
28859
  token.attrSet(match[1], match[2]);
28860
+ if (match[1] == "class" && url != null) {
28861
+ url = url.replace(match[1] + "=" + match[2], "");
28862
+ }
28863
+ }
28864
+ if (url?.slice(-1) == "?") {
28865
+ url = url.slice(0, -1);
28860
28866
  }
28861
28867
  if (url != null && url.length > 5 && url.substring(0, 5) == "badge") {
28862
28868
  const svg = `<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24"><path d="M512.58254222 96.64739555c-180.00554667 0-326.22364445 146.21809778-326.22364444 326.22364445s146.21809778 326.22364445 326.22364444 326.22364445 326.22364445-146.21809778 326.22364445-326.22364445c-0.58254222-180.00554667-146.80064-326.22364445-326.22364445-326.22364445z m125.24657778 326.22364445c0 69.32252445-55.92405333 125.24657778-125.24657778 125.24657778s-125.24657778-55.92405333-125.24657777-125.24657778 55.92405333-125.24657778 125.24657777-125.24657778c68.73998222 0 125.24657778 55.92405333 125.24657778 125.24657778zM194.51448889 576.07964445l-123.49895111 153.20860444c-6.99050667 8.73813333-8.73813333 20.97152-4.66033778 32.03982222s14.56355555 18.05880889 26.2144 19.22389334l126.41166222 11.65084444 40.77795556 121.16878222c3.49525333 11.06830222 12.81592889 18.64135111 24.46677333 20.97152 1.74762667 0.58254222 3.49525333 0.58254222 5.24288 0.58254222 9.32067555 0 18.64135111-4.07779555 24.46677334-11.65084444L436.26951111 768.31857778c-106.02268445-23.88423111-195.15164445-95.53692445-241.75502222-192.23893333zM956.47971555 729.87079111l-125.24657777-155.53877333c-46.02083555 96.70200889-134.56725333 168.93724445-241.17248 192.82147555l122.91640889 155.53877334c5.82542222 7.57304889 15.14609778 11.65084445 24.46677333 11.65084444 1.74762667 0 3.49525333 0 5.24288-0.58254222 11.06830222-1.74762667 20.97152-9.90321778 24.46677333-20.97152l40.77795556-121.16878222 126.41166222-11.65084445c11.65084445-1.16508445 21.55406222-8.15559111 26.2144-19.22389333 4.66033778-9.90321778 2.91271111-22.13660445-4.07779556-30.87473778z" fill="#2c2c2c" p-id="9779"></path></svg>`;
@@ -28918,15 +28924,31 @@ const linkPlugin = (md, externalAttrs, base) => {
28918
28924
  let match;
28919
28925
  while ((match = pattern.exec(url)) !== null) {
28920
28926
  const attrName = match[1];
28921
- const attrVal = match[2];
28922
- token.attrSet(attrName, decodeURIComponent(attrVal));
28923
- if (attrName == "video") {
28924
- token.tag = "video";
28925
- token.attrSet("src", url);
28926
- token.attrSet("controls", "controls");
28927
+ const attrVal = decodeURIComponent(match[2]);
28928
+ token.attrSet(attrName, attrVal);
28929
+ }
28930
+ let m3u8 = "";
28931
+ if (token.attrGet("m3u8") != null && token.attrGet("m3u8") == "self") {
28932
+ m3u8 = "<source src='" + url.replace(".mp4", ".m3u8") + "' tyle='application/x-mpegURL'></source>";
28933
+ }
28934
+ if (token.attrGet("class") != null && token.attrGet("class") == "video") {
28935
+ let poster = "";
28936
+ for (var i = idx; i < tokens.length; i++) {
28937
+ if (tokens[i].type == "link_open") {
28938
+ tokens[i].type = "video_open";
28939
+ tokens[i].attrSet("controls", "controls");
28940
+ } else if (tokens[i].type == "image") {
28941
+ const imgsrc = tokens[i].attrGet("src");
28942
+ if (imgsrc != null) {
28943
+ poster = imgsrc;
28944
+ }
28945
+ } else if (tokens[i].type == "link_close") {
28946
+ tokens[i].type = "video_close";
28947
+ tokens[i].tag = "video";
28948
+ }
28927
28949
  }
28950
+ return "<video controls poster='" + poster + "' ><source src='" + url + "' tyle='video/mp4'></source>" + m3u8;
28928
28951
  }
28929
- console.log(token);
28930
28952
  if (isExternal(url)) {
28931
28953
  Object.entries(externalAttrs).forEach(([key, val]) => {
28932
28954
  token.attrSet(key, val);
@@ -38533,7 +38555,7 @@ function escapeHtml(string) {
38533
38555
 
38534
38556
  var escape$1 = /*@__PURE__*/getDefaultExportFromCjs(escapeHtml_1);
38535
38557
 
38536
- var version = "1.0503.1321";
38558
+ var version = "1.0503.1604";
38537
38559
 
38538
38560
  async function renderPage(render, config, page, result, appChunk, cssChunk, assets, pageToHashMap, metadataScript, additionalHeadTags) {
38539
38561
  const routePath = `/${page.replace(/\.md$/, "")}`;
@@ -38632,7 +38654,7 @@ async function renderPage(render, config, page, result, appChunk, cssChunk, asse
38632
38654
  themeCssList = '<link rel="stylesheet" type="text/css" href="' + siteData.base + '.themekit/assets/bootstrap3/dist/css/bootstrap.min.css"/>';
38633
38655
  themeCssList += '<link rel="stylesheet" type="text/css" href="' + siteData.base + '.themekit/assets/changzhou/dist/css/style.css"/>';
38634
38656
  }
38635
- content = content.replace('"./.themekit/dist', "");
38657
+ content = content.replace("./.themekit/dist", "");
38636
38658
  content = content.replace("../.themekit/dist", "..");
38637
38659
  content = content.replace(".themekit/dist", "");
38638
38660
  const html = `<!DOCTYPE html>
@@ -41149,24 +41171,33 @@ function scaffold({
41149
41171
  const renderFile = (fileIn, fileOut) => {
41150
41172
  const filePath = path$q.resolve(templateDir, fileIn);
41151
41173
  let targetPath = path$q.resolve(resolvedRoot, fileOut);
41152
- if (useMjs && fileIn === ".themekit/config.js") {
41153
- targetPath = targetPath.replace(/\.js$/, ".mjs");
41154
- }
41155
- if (useTs) {
41156
- targetPath = targetPath.replace(/\.(m?)js$/, ".$1ts");
41174
+ if (fileIn.indexOf("/dist/") < 0) {
41175
+ if (useMjs && fileIn === ".themekit/config.js") {
41176
+ targetPath = targetPath.replace(/\.js$/, ".mjs");
41177
+ }
41178
+ if (useTs) {
41179
+ targetPath = targetPath.replace(/\.(m?)js$/, ".$1ts");
41180
+ }
41181
+ const src = fs$a.readFileSync(filePath, "utf-8");
41182
+ const compiled = template(src)(data);
41183
+ fs$a.outputFileSync(targetPath, compiled);
41184
+ } else {
41185
+ fs$a.outputFileSync(targetPath, fs$a.readFileSync(filePath, "utf-8"));
41157
41186
  }
41158
- const src = fs$a.readFileSync(filePath, "utf-8");
41159
- const compiled = template(src)(data);
41160
- fs$a.outputFileSync(targetPath, compiled);
41161
41187
  };
41162
41188
  let themeName = "/default/";
41163
41189
  const filesToScaffold = [
41164
- "index.md",
41165
- "api-examples.md",
41166
- "markdown-examples.md",
41190
+ // 'index.md',
41191
+ // 'api-examples.md',
41192
+ // 'markdown-examples.md',
41167
41193
  ".themekit/config.js"
41168
41194
  ];
41169
41195
  const filesToDist = [];
41196
+ filesToScaffold.push(
41197
+ // '.themekit/dist/videojs/videojs.css',
41198
+ // '.themekit/dist/videojs/videojs.js',
41199
+ // '.themekit/dist/videojs/videojs-contrib-hls.js'
41200
+ );
41170
41201
  if (theme === "default theme + customization" /* DefaultCustom */) {
41171
41202
  filesToScaffold.push(
41172
41203
  ".themekit/theme/index.js",
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "themekit-js",
3
- "version": "1.0503.1321",
3
+ "version": "1.0503.1604",
4
4
  "description": "基于VitePress开发的Markdown静态网站生成器",
5
5
  "type": "module",
6
- "packageManager": "pnpm@8.15.6",
6
+ "packageManager": "pnpm@8.15.6",
7
7
  "main": "dist/node/index.js",
8
8
  "types": "types/index.d.ts",
9
9
  "exports": {