@sugarat/theme 0.4.0 → 0.4.1

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.
Files changed (3) hide show
  1. package/node.js +1 -1
  2. package/package.json +1 -1
  3. package/src/node.ts +3 -2
package/node.js CHANGED
@@ -764,6 +764,7 @@ function providePageData(cfg) {
764
764
  // src/node.ts
765
765
  function getThemeConfig(cfg = {}) {
766
766
  checkConfig(cfg);
767
+ cfg.mermaid = cfg.mermaid ?? false;
767
768
  const pagesData = [];
768
769
  const extraVPConfig = {
769
770
  vite: {}
@@ -772,7 +773,6 @@ function getThemeConfig(cfg = {}) {
772
773
  registerVitePlugins(extraVPConfig, vitePlugins);
773
774
  const markdownPlugin = getMarkdownPlugins(cfg);
774
775
  registerMdPlugins(extraVPConfig, markdownPlugin);
775
- cfg.mermaid = cfg.mermaid ?? false;
776
776
  if (cfg?.mermaid !== false) {
777
777
  patchMermaidPluginCfg(extraVPConfig);
778
778
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sugarat/theme",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "简约风的 Vitepress 博客主题,sugarat vitepress blog theme",
5
5
  "author": "sugar",
6
6
  "license": "MIT",
package/src/node.ts CHANGED
@@ -17,6 +17,9 @@ export function getThemeConfig(cfg: Partial<Theme.BlogConfig> = {}) {
17
17
  // 配置校验
18
18
  checkConfig(cfg)
19
19
 
20
+ // 默认不开启 markdown 图表,会明显影响构建速度
21
+ cfg.mermaid = cfg.mermaid ?? false
22
+
20
23
  // 文章数据
21
24
  const pagesData: Theme.PageData[] = []
22
25
  const extraVPConfig: any = {
@@ -34,8 +37,6 @@ export function getThemeConfig(cfg: Partial<Theme.BlogConfig> = {}) {
34
37
  registerMdPlugins(extraVPConfig, markdownPlugin)
35
38
 
36
39
  // patch extraVPConfig
37
- // 默认不开启 markdown 图表,会明显影响构建速度
38
- cfg.mermaid = cfg.mermaid ?? false
39
40
  if (cfg?.mermaid !== false) {
40
41
  patchMermaidPluginCfg(extraVPConfig)
41
42
  }