mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 23:57:22 +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
|
@ -10,12 +10,13 @@ const path = require('path');
|
|||
const fs = require('fs-extra');
|
||||
const {parse, idx, normalizeUrl, generate} = require('@docusaurus/utils');
|
||||
|
||||
// TODO: Use a better slugify function that doesn't rely on a specific file extension.
|
||||
function fileToUrl(fileName) {
|
||||
return fileName
|
||||
.replace('-', '/')
|
||||
.replace('-', '/')
|
||||
.replace('-', '/')
|
||||
.replace(/\.md$/, '');
|
||||
.replace(/\.mdx?$/, '');
|
||||
}
|
||||
|
||||
const DEFAULT_OPTIONS = {
|
||||
|
@ -42,6 +43,10 @@ class DocusaurusPluginContentBlog {
|
|||
return 'docusaurus-plugin-content-blog';
|
||||
}
|
||||
|
||||
getPathsToWatch() {
|
||||
return [this.contentPath];
|
||||
}
|
||||
|
||||
// Fetches blog contents and returns metadata for the contents.
|
||||
async loadContent() {
|
||||
const {pageCount, include, routeBasePath} = this.options;
|
||||
|
@ -150,10 +155,6 @@ class DocusaurusPluginContentBlog {
|
|||
});
|
||||
});
|
||||
}
|
||||
|
||||
getPathsToWatch() {
|
||||
return [this.contentPath];
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = DocusaurusPluginContentBlog;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue