mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-06 04:42:40 +02:00
feat(v2): docs plugin initial work (#1327)
* feat(v2): pluginify docs * feat(v2): implement docs plugin * fix(v2): fix bugs in docs plugin for translation and versioning
This commit is contained in:
parent
c33e874e1c
commit
a70d9b6720
32 changed files with 576 additions and 371 deletions
|
@ -7,14 +7,12 @@
|
|||
|
||||
const globby = require('globby');
|
||||
const path = require('path');
|
||||
|
||||
// TODO: Do not make it relative because plugins can be from node_modules.
|
||||
const {encodePath, fileToPath, idx} = require('@docusaurus/utils');
|
||||
|
||||
const DEFAULT_OPTIONS = {
|
||||
metadataKey: 'pagesMetadata',
|
||||
metadataFileName: 'pagesMetadata.json',
|
||||
path: 'pages', // Path to data on filesystem.
|
||||
path: 'pages', // Path to data on filesystem, relative to site dir.
|
||||
routeBasePath: '', // URL Route.
|
||||
include: ['**/*.{js,jsx}'], // Extensions to include.
|
||||
component: '@theme/Pages',
|
||||
|
@ -31,6 +29,10 @@ class DocusaurusPluginContentPages {
|
|||
return 'docusaurus-plugin-content-pages';
|
||||
}
|
||||
|
||||
getPathsToWatch() {
|
||||
return [this.contentPath];
|
||||
}
|
||||
|
||||
async loadContent() {
|
||||
const {include} = this.options;
|
||||
const {env, siteConfig} = this.context;
|
||||
|
@ -102,10 +104,6 @@ class DocusaurusPluginContentPages {
|
|||
});
|
||||
});
|
||||
}
|
||||
|
||||
getPathsToWatch() {
|
||||
return [this.contentPath];
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = DocusaurusPluginContentPages;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue