@sugarat/theme 0.1.5 → 0.1.7

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.d.ts CHANGED
@@ -56,7 +56,7 @@ declare namespace Theme {
56
56
  mapping?: string;
57
57
  inputPosition?: 'top' | 'bottom';
58
58
  lang?: string;
59
- loading?: 'lazy' | '';
59
+ loading?: 'lazy' | 'auto' | 'eager';
60
60
  }
61
61
  interface HotArticle {
62
62
  title?: string;
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(`^\\.\\/${import_path.default.join(srcDir, "/")}`),
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(new RegExp(`^${import_path.default.join(srcDir, "/")}`), "");
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.5",
3
+ "version": "0.1.7",
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": "^1.0.0-alpha.33",
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",
@@ -64,6 +64,12 @@ const { Layout } = Theme
64
64
  max-width: 1126px;
65
65
  }
66
66
 
67
+ @media screen and (min-width: 960px) {
68
+ .home {
69
+ padding-top: var(--vp-nav-height);
70
+ }
71
+ }
72
+
67
73
  .header-banner {
68
74
  width: 100%;
69
75
  padding: 60px 0;
@@ -31,7 +31,7 @@
31
31
  :data-theme="isDark ? 'dark' : 'light'"
32
32
  :data-lang="commentConfig.lang || 'zh-CN'"
33
33
  crossorigin="anonymous"
34
- :data-loading="commentConfig.loading || ''"
34
+ :data-loading="commentConfig.loading || 'eager'"
35
35
  async
36
36
  >
37
37
  </component>
@@ -93,7 +93,10 @@ watch(
93
93
  showComment.value = false
94
94
  setTimeout(() => {
95
95
  showComment.value = true
96
- }, 100)
96
+ }, 200)
97
+ },
98
+ {
99
+ immediate: true
97
100
  }
98
101
  )
99
102
  </script>
@@ -63,7 +63,7 @@ export namespace Theme {
63
63
  mapping?: string
64
64
  inputPosition?: 'top' | 'bottom'
65
65
  lang?: string
66
- loading?: 'lazy' | ''
66
+ loading?: 'lazy' | 'auto' | 'eager'
67
67
  }
68
68
 
69
69
  export interface HotArticle {
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(`^\\.\\/${path.join(srcDir, '/')}`),
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(new RegExp(`^${path.join(srcDir, '/')}`), '')
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')
@@ -38,6 +38,15 @@ html[class='dark'] {
38
38
  );
39
39
  }
40
40
 
41
+ @media screen and (min-width: 960px) {
42
+ #VPContent.is-home.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);