mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-03 11:22:30 +02:00
fix(v2): handle non existent blog, docs, pages (#1459)
* fix(v2): handle non existent blog, docs, pages * nits
This commit is contained in:
parent
f84abfe2d1
commit
55d7920825
5 changed files with 41 additions and 12 deletions
|
@ -56,6 +56,10 @@ class DocusaurusPluginContentBlog {
|
|||
const {siteConfig} = this.context;
|
||||
const blogDir = this.contentPath;
|
||||
|
||||
if (!fs.existsSync(blogDir)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const {baseUrl} = siteConfig;
|
||||
const blogFiles = await globby(include, {
|
||||
cwd: blogDir,
|
||||
|
@ -158,6 +162,10 @@ class DocusaurusPluginContentBlog {
|
|||
}
|
||||
|
||||
async contentLoaded({content: blogContents, actions}) {
|
||||
if (!blogContents) {
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
blogListComponent,
|
||||
blogPostComponent,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue