pengzhanbo 4d2361a704
feat(theme)!: add collections support (#704)
* feat(theme)!: add collection support
2025-10-07 23:13:09 +08:00

2.2 KiB

title, createTime, permalink, tags
title createTime permalink tags
1.0.0-rc.154 更新说明 2025/06/19 18:10:18 /article/yw0dmwcm/
破坏性更新

在本次更新中,主题移除了 vuepress-plugin-md-enhance 插件。

由该插件提供支持的 图表 Chartjs ECharts mermaid flowchart plantuml 功能,迁移到 @vuepress/plugin-markdown-chart 插件。

因此主题也同步完成了插件的迁移。

至此,在主题中,由 vuepress-plugin-md-enhance 插件提供的相关功能,已全部迁移至官方 vuepress/ecosystem 仓库的相关插件。因此主题将从 1.0.0-rc.154 开始,安全的移除 vuepress-plugin-md-enhance 插件。

受此影响,如果你在 .vuepress/client.ts 中,有使用从 vuepress-plugin-md-enhance 导入的功能:

import { defineMermaidConfig } from 'vuepress-plugin-md-enhance/client'

defineMermaidConfig({
  theme: 'dark'
})

需要进行修改:

import { defineMermaidConfig } from '@vuepress/plugin-markdown-chart/client' // [!code ++]
import { defineMermaidConfig } from 'vuepress-plugin-md-enhance/client' // [!code --]

defineMermaidConfig({
  theme: 'dark'
})

如果您有在 .vuepress/config.ts 的主题配置中,使用 plugins.mdEnhance 配置,需要进行修改:

import { defineUserConfig } from 'vuepress'
import { plumeTheme } from 'vuepress-theme-plume'

export default defineUserConfig({
  theme: plumeTheme({
    plugins: {
      mdEnhance: {
        mermaid: true,
        chartjs: true,
        // ...
      }
    }
  })
})

需要进行修改:

import { defineUserConfig } from 'vuepress'
import { plumeTheme } from 'vuepress-theme-plume'

export default defineUserConfig({
  theme: plumeTheme({
    plugins: {
      mdEnhance: { // [!code --:5]
        mermaid: true,
        chartjs: true,
        // ...
      }
    },
    markdown: { // [!code ++:5]
      mermaid: true,
      chartjs: true,
      // ...
    }
  })
})

如果您在使用过程中遇到问题,请在 GitHub Issue 上反馈。