vuepress-plugin-thirdparty-search

1.0.2 • Public • Published

vuepress-plugin-thirdparty-search

此插件是基于官方的搜索框插件 @vuepress/plugin-search 做了功能添加,添加的功能如下:

  • 在搜索结果最底部添加第三方搜索链接

使用

安装

npm i vuepress-plugin-thirdparty-search -D

.vuepress/config.jsplugins选项添加插件,并配置第三方搜索链接:

// .vuepress/config.js
module.exports = {
  plugins: [
    ['thirdparty-search', {
      thirdparty: [ // 可选,默认 []
        {
          title: '在MDN中搜索', // 在搜索结果显示的文字
          frontUrl: 'https://developer.mozilla.org/zh-CN/search?q=', // 搜索链接的前面部分
          behindUrl: '' // 搜索链接的后面部分,可选,默认 ''
        },
        {
          title: '在Runoob中搜索',
          frontUrl: 'https://www.runoob.com/?s=',
        },
        {
          title: '在Vue API中搜索',
          frontUrl: 'https://cn.vuejs.org/v2/api/#',
        }
      ]
    }], 
  ]
}
  • 此插件会覆盖原本官方的 plugin-search 插件,但原插件的参数选项仍适用。更多配置请查看:plugin-search

  • 此插件在官方默认主题也适用。

Package Sidebar

Install

npm i vuepress-plugin-thirdparty-search

Weekly Downloads

1,203

Version

1.0.2

License

MIT

Unpacked Size

11.5 kB

Total Files

6

Last publish

Collaborators

  • evan_xu