themekit-js 1.1.9 → 1.1.10
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/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-
|
|
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-DrcWsG6z.js';
|
|
2
2
|
import { createLogger } from 'vite';
|
|
3
3
|
import 'path';
|
|
4
4
|
import 'shiki';
|
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, a as getDefaultExportFromCjs } from './serve-
|
|
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-
|
|
3
|
+
import { g as glob, c as createMarkdownRenderer, f as fs, m as matter, a as getDefaultExportFromCjs } from './serve-DrcWsG6z.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-DrcWsG6z.js';
|
|
5
5
|
import path from 'path';
|
|
6
6
|
import 'crypto';
|
|
7
7
|
import 'module';
|
|
@@ -37139,17 +37139,24 @@ const imagePlugin = (md, { lazyLoading } = {}, base) => {
|
|
|
37139
37139
|
md.renderer.rules.image = (tokens, idx, options, env, self) => {
|
|
37140
37140
|
const token = tokens[idx];
|
|
37141
37141
|
let url = token.attrGet("src");
|
|
37142
|
-
|
|
37143
|
-
|
|
37144
|
-
|
|
37145
|
-
|
|
37146
|
-
|
|
37147
|
-
|
|
37148
|
-
|
|
37149
|
-
const
|
|
37150
|
-
|
|
37151
|
-
|
|
37152
|
-
|
|
37142
|
+
console.log(url);
|
|
37143
|
+
const pattern = /[?&]([^=#]+)=([^&#]*)/g;
|
|
37144
|
+
let match;
|
|
37145
|
+
while ((match = pattern.exec(url == null ? "" : url)) !== null) {
|
|
37146
|
+
token.attrSet(match[1], match[2]);
|
|
37147
|
+
}
|
|
37148
|
+
if (url != null && url.length > 5 && url.substring(0, 5) == "badge") {
|
|
37149
|
+
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>`;
|
|
37150
|
+
const base64 = Buffer.from(svg).toString("base64");
|
|
37151
|
+
token.attrSet("src", "data:image/svg+xml;base64," + base64);
|
|
37152
|
+
} else {
|
|
37153
|
+
if (url && !EXTERNAL_URL_RE.test(url)) {
|
|
37154
|
+
if (!/^\.?\//.test(url))
|
|
37155
|
+
url = "./" + url;
|
|
37156
|
+
if (url.substring(0, 1) == "/" && base != null) {
|
|
37157
|
+
url = base + url.substring(1, url.length);
|
|
37158
|
+
}
|
|
37159
|
+
token.attrSet("src", decodeURIComponent(url));
|
|
37153
37160
|
}
|
|
37154
37161
|
}
|
|
37155
37162
|
if (lazyLoading) {
|
|
@@ -46709,7 +46716,7 @@ function escapeHtml(string) {
|
|
|
46709
46716
|
|
|
46710
46717
|
var escape$1 = /*@__PURE__*/getDefaultExportFromCjs(escapeHtml_1);
|
|
46711
46718
|
|
|
46712
|
-
var version = "1.1.
|
|
46719
|
+
var version = "1.1.10";
|
|
46713
46720
|
|
|
46714
46721
|
async function renderPage(render, config, page, result, appChunk, cssChunk, assets, pageToHashMap, metadataScript, additionalHeadTags) {
|
|
46715
46722
|
const routePath = `/${page.replace(/\.md$/, "")}`;
|
|
@@ -47016,6 +47023,18 @@ async function build(root, buildOptions = {}) {
|
|
|
47016
47023
|
await generateSitemap(siteConfig);
|
|
47017
47024
|
await siteConfig.buildEnd?.(siteConfig);
|
|
47018
47025
|
clearCache();
|
|
47026
|
+
siteConfig.pages.forEach((page) => {
|
|
47027
|
+
if (path$q.basename(page) == "README.md") {
|
|
47028
|
+
const ext = path$q.extname(page);
|
|
47029
|
+
const checkFile = path$q.resolve(siteConfig.outDir, page.substring(0, page.length - ext.length) + ".html");
|
|
47030
|
+
if (fs$a.existsSync(checkFile)) {
|
|
47031
|
+
const indexFile = path$q.resolve(siteConfig.outDir, path$q.dirname(page), "index.html");
|
|
47032
|
+
if (!fs$a.existsSync(indexFile)) {
|
|
47033
|
+
fs$a.writeFile(indexFile, fs$a.readFileSync(checkFile));
|
|
47034
|
+
}
|
|
47035
|
+
}
|
|
47036
|
+
}
|
|
47037
|
+
});
|
|
47019
47038
|
siteConfig.logger.info(
|
|
47020
47039
|
`build complete in ${((Date.now() - start) / 1e3).toFixed(2)}s.`
|
|
47021
47040
|
);
|
package/package.json
CHANGED