//该插件简化了 [markdown-it-container](https://github.com/markdown-it/markdown-it-container) 的使用方法 import { containerPlugin } from '@vuepress/plugin-container' //该插件会为你 Markdown 内容中的外部链接添加一个图标 import { externalLinkIconPlugin } from '@vuepress/plugin-external-link-i...
在Vuepress1.0中,md文件能自动识别导出的.vue文件,Vuepress2.0中需要安装插件并做好配置 步骤1: 安装 @vuepress/plugin-register-components 插件 1 yarn add @vuepress/plugin-register-components@next -D 步骤2:config.js中配置修改如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ...
Vue.use会自动阻止多次注册相同插件,届时即使多次调用也只会注册一次该插件,在像 CommonJS 这样的模块环境中,你应该始终显式地调用Vue.use()。 当install 方法被同一个插件多次调用,插件将只会被安装一次。 二、开发插件 Vue.js 的插件应该暴露一个install方法。这个方法的第一个参数是Vue构造器,第二个参数是一...
实现 主要利用了之前自己开发的csdnsynchexo提供的爬取网站文章的能力结合vuepress2提供的插件能力,150行代码即可实现,源码详见,下面简单介绍下相关实现点 文章拉取 在vuepress2的onInitialized中进行拉取(使用csdnsynchexo提供的run函数),并进行相关的数据处理,然后通过插件传递的app实例往app.pages中添加我们拉取回来的...
0 安装插件 npm i @ddongui/vuepress-plugin-demo-block -D 1 导入到配置文件(config.ts) import{defineUserConfig}from"vuepress";// 导入插件importvuepressPluginDemoCodefrom"@ddongui/vuepress-plugin-demo-block";exportdefaultdefineUserConfig({// 使用插件plugins:[vuepressPluginDemoCode()],}) ...
在你的vuepress项目中启用此插件 yarn add -D vuepress-plugin-comment2@next my-book/docs/.vuepress/config.js plugins: [ ...commentPlugin({provider:"Giscus",repo:"dshvv/red-treasure-book",repoId:"MDEwOlJlcG9zaXRvcnk0MDcxNDYxODA=",category:"Announcements",categoryId:"DIC_kwDOGESOxM4CPs5U...
因为VuePress除了默认的主题外,提供了扩展主题、扩展插件的能力,不同的主题又组织了不同的插件集合来完成开箱即用的功能。 所以,你首先应该使用哪款主题作为你的个人完整风格。 比较热门你的主题有: vuepress默认主题 21.7k⭐ vuepress-theme-hope 1.4k⭐ ...
简介:vuepress2一次性获取所有frontmatter 上帝是孤独的,恶魔却总在拉帮结伙。——梭罗的《瓦尔登湖》。 接上文: vuepress获取所有页面frontmatter 这次是vuepressv2.0.0-beta.66 首页| VuePress 核心代码: // .vuepress/getAllFrontmatter.smodule.exports = {name: 'get-all-frontmatter',extendsPage: (page,...
2.0.0-rc.16•Public• Publisheda year ago vuepress-plugin-copy-code2 VuePress copy code plugin📋 / VuePress 代码复制插件📋 VuePress copy code plugin📋 / VuePress 代码复制插件 📋 ##Official Docs|官方文档 Install #pnpmpnpm add -D vuepress-plugin-copy-code2#npmnpm i -D vuepress-plug...
第一步:创建插件文件.vuepress/plugins/page.js:export default { name: 'vuepress-plugin-page', onInitialized(app) { const lists = [] app.pages.forEach((item:Page) => { // 排除不需要的页面 if (/^\/[\s\S]*\/[\s\S]*/.test(item.path)) { // 没有直接将整个item放进lists是为了...