-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ability to use classic theme/preset while not using docs/pages withou…
…t trouble. #3360
- Loading branch information
Showing
8 changed files
with
130 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
packages/docusaurus-theme-classic/src/theme/hooks/useDocs.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
// See https://github.com/facebook/docusaurus/issues/3360 | ||
// TODO find a better solution, this shouldn't be needed | ||
throw new Error( | ||
"The docs plugin is not used, so you can't require the useDocs hooks. ", | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
module.exports = { | ||
title: 'Docusaurus blog only!', | ||
tagline: 'Build optimized websites quickly, focus on your content', | ||
organizationName: 'facebook', | ||
projectName: 'docusaurus', | ||
baseUrl: '/blog-only/', | ||
url: 'https://v2.docusaurus.io', | ||
onBrokenLinks: 'throw', | ||
favicon: 'img/docusaurus.ico', | ||
themes: ['@docusaurus/theme-live-codeblock'], | ||
plugins: [], | ||
presets: [ | ||
[ | ||
'@docusaurus/preset-classic', | ||
{ | ||
docs: false, | ||
pages: false, | ||
blog: { | ||
routeBasePath: '/', | ||
path: '../website-1.x/blog', | ||
editUrl: | ||
'https://github.com/facebook/docusaurus/edit/master/website-1.x/', | ||
postsPerPage: 3, | ||
feedOptions: { | ||
type: 'all', | ||
copyright: `Copyright © ${new Date().getFullYear()} Facebook, Inc.`, | ||
}, | ||
}, | ||
theme: { | ||
customCss: require.resolve('./src/css/custom.css'), | ||
}, | ||
}, | ||
], | ||
], | ||
themeConfig: { | ||
image: 'img/docusaurus-soc.png', | ||
navbar: { | ||
hideOnScroll: true, | ||
title: 'Docusaurus', | ||
logo: { | ||
alt: 'Docusaurus Logo', | ||
src: 'img/docusaurus.svg', | ||
srcDark: 'img/docusaurus_keytar.svg', | ||
}, | ||
}, | ||
footer: { | ||
style: 'dark', | ||
logo: { | ||
alt: 'Facebook Open Source Logo', | ||
src: 'img/oss_logo.png', | ||
href: 'https://opensource.facebook.com', | ||
}, | ||
copyright: `Copyright © ${new Date().getFullYear()} Facebook, Inc. Built with Docusaurus.`, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters