@sugarat/theme 0.5.1 → 0.5.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/node.js +17 -3
- package/node.mjs +17 -3
- package/package.json +7 -7
- package/src/node.ts +14 -1
- package/src/utils/client/index.ts +0 -7
- package/src/utils/node/vitePlugins.ts +2 -1
package/node.js
CHANGED
|
@@ -41,7 +41,7 @@ module.exports = __toCommonJS(node_exports);
|
|
|
41
41
|
// src/utils/node/mdPlugins.ts
|
|
42
42
|
var import_module = require("module");
|
|
43
43
|
|
|
44
|
-
// ../../node_modules/.pnpm/vitepress-plugin-tabs@0.2.0_vitepress@1.
|
|
44
|
+
// ../../node_modules/.pnpm/vitepress-plugin-tabs@0.2.0_vitepress@1.5.0_@algolia+client-search@4.19.1_@types+node@20.6.3__hxsuj227nyqox5emdzcwg6gwva/node_modules/vitepress-plugin-tabs/dist/index.js
|
|
45
45
|
var tabsMarker = "=tabs";
|
|
46
46
|
var tabsMarkerLen = tabsMarker.length;
|
|
47
47
|
var ruleBlockTabs = (state, startLine, endLine, silent) => {
|
|
@@ -571,7 +571,8 @@ function getVitePlugins(cfg = {}) {
|
|
|
571
571
|
}
|
|
572
572
|
function registerVitePlugins(vpCfg, plugins) {
|
|
573
573
|
vpCfg.vite = {
|
|
574
|
-
plugins
|
|
574
|
+
plugins,
|
|
575
|
+
...vpCfg.vite
|
|
575
576
|
};
|
|
576
577
|
}
|
|
577
578
|
function inlineInjectMermaidClient() {
|
|
@@ -738,7 +739,20 @@ function getThemeConfig(cfg = {}) {
|
|
|
738
739
|
cfg.mermaid = cfg.mermaid ?? false;
|
|
739
740
|
const pagesData = [];
|
|
740
741
|
const extraVPConfig = {
|
|
741
|
-
vite: {
|
|
742
|
+
vite: {
|
|
743
|
+
// see https://sass-lang.com/documentation/breaking-changes/legacy-js-api/
|
|
744
|
+
css: {
|
|
745
|
+
preprocessorOptions: {
|
|
746
|
+
scss: {
|
|
747
|
+
api: "modern"
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
},
|
|
751
|
+
build: {
|
|
752
|
+
// https://vite.dev/config/build-options.html#build-chunksizewarninglimit
|
|
753
|
+
chunkSizeWarningLimit: 2048
|
|
754
|
+
}
|
|
755
|
+
}
|
|
742
756
|
};
|
|
743
757
|
const vitePlugins = getVitePlugins(cfg);
|
|
744
758
|
registerVitePlugins(extraVPConfig, vitePlugins);
|
package/node.mjs
CHANGED
|
@@ -9,7 +9,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
9
9
|
// src/utils/node/mdPlugins.ts
|
|
10
10
|
import { createRequire } from "module";
|
|
11
11
|
|
|
12
|
-
// ../../node_modules/.pnpm/vitepress-plugin-tabs@0.2.0_vitepress@1.
|
|
12
|
+
// ../../node_modules/.pnpm/vitepress-plugin-tabs@0.2.0_vitepress@1.5.0_@algolia+client-search@4.19.1_@types+node@20.6.3__hxsuj227nyqox5emdzcwg6gwva/node_modules/vitepress-plugin-tabs/dist/index.js
|
|
13
13
|
var tabsMarker = "=tabs";
|
|
14
14
|
var tabsMarkerLen = tabsMarker.length;
|
|
15
15
|
var ruleBlockTabs = (state, startLine, endLine, silent) => {
|
|
@@ -539,7 +539,8 @@ function getVitePlugins(cfg = {}) {
|
|
|
539
539
|
}
|
|
540
540
|
function registerVitePlugins(vpCfg, plugins) {
|
|
541
541
|
vpCfg.vite = {
|
|
542
|
-
plugins
|
|
542
|
+
plugins,
|
|
543
|
+
...vpCfg.vite
|
|
543
544
|
};
|
|
544
545
|
}
|
|
545
546
|
function inlineInjectMermaidClient() {
|
|
@@ -706,7 +707,20 @@ function getThemeConfig(cfg = {}) {
|
|
|
706
707
|
cfg.mermaid = cfg.mermaid ?? false;
|
|
707
708
|
const pagesData = [];
|
|
708
709
|
const extraVPConfig = {
|
|
709
|
-
vite: {
|
|
710
|
+
vite: {
|
|
711
|
+
// see https://sass-lang.com/documentation/breaking-changes/legacy-js-api/
|
|
712
|
+
css: {
|
|
713
|
+
preprocessorOptions: {
|
|
714
|
+
scss: {
|
|
715
|
+
api: "modern"
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
},
|
|
719
|
+
build: {
|
|
720
|
+
// https://vite.dev/config/build-options.html#build-chunksizewarninglimit
|
|
721
|
+
chunkSizeWarningLimit: 2048
|
|
722
|
+
}
|
|
723
|
+
}
|
|
710
724
|
};
|
|
711
725
|
const vitePlugins = getVitePlugins(cfg);
|
|
712
726
|
registerVitePlugins(extraVPConfig, vitePlugins);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sugarat/theme",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "简约风的 Vitepress 博客主题,sugarat vitepress blog theme",
|
|
5
5
|
"author": "sugar",
|
|
6
6
|
"license": "MIT",
|
|
@@ -53,20 +53,20 @@
|
|
|
53
53
|
"vitepress-plugin-group-icons": "^1.2.4",
|
|
54
54
|
"vitepress-plugin-mermaid": "2.0.13",
|
|
55
55
|
"vitepress-plugin-tabs": "0.2.0",
|
|
56
|
-
"@sugarat/theme-shared": "0.0.3",
|
|
57
|
-
"vitepress-plugin-pagefind": "0.4.10",
|
|
58
56
|
"vitepress-plugin-announcement": "0.1.3",
|
|
59
|
-
"vitepress-plugin-rss": "0.3.0"
|
|
57
|
+
"vitepress-plugin-rss": "0.3.0",
|
|
58
|
+
"@sugarat/theme-shared": "0.0.3",
|
|
59
|
+
"vitepress-plugin-pagefind": "0.4.12"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@element-plus/icons-vue": "^2.3.1",
|
|
63
63
|
"artalk": "^2.8.5",
|
|
64
64
|
"element-plus": "^2.7.2",
|
|
65
|
-
"pagefind": "^1.
|
|
66
|
-
"sass": "^1.
|
|
65
|
+
"pagefind": "^1.2.0",
|
|
66
|
+
"sass": "^1.80.6",
|
|
67
67
|
"typescript": "^5.4.5",
|
|
68
68
|
"vite": "^5.4.9",
|
|
69
|
-
"vitepress": "1.
|
|
69
|
+
"vitepress": "1.5.0",
|
|
70
70
|
"vue": "^3.5.12",
|
|
71
71
|
"vitepress-plugin-51la": "0.1.0"
|
|
72
72
|
},
|
package/src/node.ts
CHANGED
|
@@ -23,7 +23,20 @@ export function getThemeConfig(cfg: Partial<Theme.BlogConfig> = {}) {
|
|
|
23
23
|
// 文章数据
|
|
24
24
|
const pagesData: Theme.PageData[] = []
|
|
25
25
|
const extraVPConfig: any = {
|
|
26
|
-
vite: {
|
|
26
|
+
vite: {
|
|
27
|
+
// see https://sass-lang.com/documentation/breaking-changes/legacy-js-api/
|
|
28
|
+
css: {
|
|
29
|
+
preprocessorOptions: {
|
|
30
|
+
scss: {
|
|
31
|
+
api: 'modern',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
build: {
|
|
36
|
+
// https://vite.dev/config/build-options.html#build-chunksizewarninglimit
|
|
37
|
+
chunkSizeWarningLimit: 2048
|
|
38
|
+
}
|
|
39
|
+
},
|
|
27
40
|
}
|
|
28
41
|
|
|
29
42
|
// 获取要加载的vite插件
|
|
@@ -94,13 +94,6 @@ export default function countWord(data: string) {
|
|
|
94
94
|
return count
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
export function chineseSearchOptimize(input: string) {
|
|
98
|
-
return input
|
|
99
|
-
.replace(/[\u4E00-\u9FA5]/g, ' $& ')
|
|
100
|
-
.replace(/\s+/g, ' ')
|
|
101
|
-
.trim()
|
|
102
|
-
}
|
|
103
|
-
|
|
104
97
|
/**
|
|
105
98
|
* 根据Github地址跨域获取最后更新时间
|
|
106
99
|
* @param url
|