refactor(v2): change plugin api (#1547)

* misc(v2): new plugin format example

* refactor(v2): make all plugins a function returning objects

* misc: add CHANGELOG

* misc(v2): update CHANGELOG

* misc(v2): fix tests

* misc(v2): convert swizzle command

* misc(v2): convert sitemap back to commonjs
This commit is contained in:
Yangshun Tay 2019-06-02 20:37:22 -07:00 committed by GitHub
parent 9feb7b2c64
commit 6a814ac64a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 709 additions and 725 deletions

View file

@ -7,21 +7,12 @@
const path = require('path');
const DEFAULT_OPTIONS = {};
module.exports = function() {
return {
name: 'docusaurus-theme-search-algolia',
class DocusaurusThemeSearchAlgolia {
constructor(context, opts) {
this.options = {...DEFAULT_OPTIONS, ...opts};
this.context = context;
}
getName() {
return 'docusaurus-theme-search-algolia';
}
getThemePath() {
return path.resolve(__dirname, './theme');
}
}
module.exports = DocusaurusThemeSearchAlgolia;
getThemePath() {
return path.resolve(__dirname, './theme');
},
};
};