@sugarat/theme 0.1.5 → 0.1.6
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 +9 -2
- package/package.json +5 -5
- package/src/components/BlogApp.vue +6 -0
- package/src/node.ts +13 -2
- package/src/styles/index.scss +9 -0
package/node.js
CHANGED
|
@@ -78,11 +78,18 @@ function getThemeConfig(cfg) {
|
|
|
78
78
|
let route = v.replace(".md", "");
|
|
79
79
|
if (route.startsWith("./")) {
|
|
80
80
|
route = route.replace(
|
|
81
|
-
new RegExp(
|
|
81
|
+
new RegExp(
|
|
82
|
+
`^\\.\\/${import_path.default.join(srcDir, "/").replace(new RegExp(`\\${import_path.default.sep}`, "g"), "/")}`
|
|
83
|
+
),
|
|
82
84
|
""
|
|
83
85
|
);
|
|
84
86
|
} else {
|
|
85
|
-
route = route.replace(
|
|
87
|
+
route = route.replace(
|
|
88
|
+
new RegExp(
|
|
89
|
+
`^${import_path.default.join(srcDir, "/").replace(new RegExp(`\\${import_path.default.sep}`, "g"), "/")}`
|
|
90
|
+
),
|
|
91
|
+
""
|
|
92
|
+
);
|
|
86
93
|
}
|
|
87
94
|
const fileContent = import_fs.default.readFileSync(v, "utf-8");
|
|
88
95
|
const meta = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sugarat/theme",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "简约风的 Vitepress 博客主题,sugarat vitepress blog theme",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"exports": {
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"gray-matter": "^4.0.3"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
+
"@element-plus/icons-vue": "^2.0.10",
|
|
42
|
+
"element-plus": "^2.2.28",
|
|
41
43
|
"sass": "^1.56.1",
|
|
42
44
|
"tsup": " ^6.5.0",
|
|
43
45
|
"typescript": "^4.8.2",
|
|
44
|
-
"vitepress": "
|
|
45
|
-
"vue": "^3.2.45"
|
|
46
|
-
"@element-plus/icons-vue": "^2.0.10",
|
|
47
|
-
"element-plus": "^2.2.28"
|
|
46
|
+
"vitepress": "1.0.0-alpha.46",
|
|
47
|
+
"vue": "^3.2.45"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"dev": "vitepress dev demo",
|
package/src/node.ts
CHANGED
|
@@ -20,11 +20,22 @@ export function getThemeConfig(cfg?: Partial<Theme.BlogConfig>) {
|
|
|
20
20
|
// 去除 srcDir 处理目录名
|
|
21
21
|
if (route.startsWith('./')) {
|
|
22
22
|
route = route.replace(
|
|
23
|
-
new RegExp(
|
|
23
|
+
new RegExp(
|
|
24
|
+
`^\\.\\/${path
|
|
25
|
+
.join(srcDir, '/')
|
|
26
|
+
.replace(new RegExp(`\\${path.sep}`, 'g'), '/')}`
|
|
27
|
+
),
|
|
24
28
|
''
|
|
25
29
|
)
|
|
26
30
|
} else {
|
|
27
|
-
route = route.replace(
|
|
31
|
+
route = route.replace(
|
|
32
|
+
new RegExp(
|
|
33
|
+
`^${path
|
|
34
|
+
.join(srcDir, '/')
|
|
35
|
+
.replace(new RegExp(`\\${path.sep}`, 'g'), '/')}`
|
|
36
|
+
),
|
|
37
|
+
''
|
|
38
|
+
)
|
|
28
39
|
}
|
|
29
40
|
|
|
30
41
|
const fileContent = fs.readFileSync(v, 'utf-8')
|
package/src/styles/index.scss
CHANGED
|
@@ -38,6 +38,15 @@ html[class='dark'] {
|
|
|
38
38
|
);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
@media screen and (min-width: 960px) {
|
|
42
|
+
#VPContent.VPContent{
|
|
43
|
+
padding-top: 0;
|
|
44
|
+
.VPHome{
|
|
45
|
+
min-height: 100vh;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
41
50
|
@media screen and (max-width: 959px) {
|
|
42
51
|
.VPNav {
|
|
43
52
|
background-color: var(--nav-bgc);
|