docusaurus/packages/docusaurus-preset-classic/src/index.js
Yangshun Tay e5e085b33d
chore(v2): make v2 docs plugin legacy (#1639)
* chore(v2): make v2 docs plugin legacy

* chore(v2): update fixtures
2019-07-05 17:20:46 -07:00

28 lines
925 B
JavaScript

/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
module.exports = function preset(context, opts = {}) {
const {siteConfig = {}} = context;
const {themeConfig} = siteConfig;
const {algolia, googleAnalytics, gtag} = themeConfig;
return {
themes: [
['@docusaurus/theme-classic', opts.theme],
// Don't add this if algolia config is not defined
algolia && '@docusaurus/theme-search-algolia',
],
plugins: [
['@docusaurus/plugin-content-docs-legacy', opts.docs],
['@docusaurus/plugin-content-blog', opts.blog],
['@docusaurus/plugin-content-pages', opts.pages],
googleAnalytics && '@docusaurus/plugin-google-analytics',
gtag && '@docusaurus/plugin-google-gtag',
['@docusaurus/plugin-sitemap', opts.sitemap],
],
};
};