forked from facebookarchive/draft-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade to Docusaurus 2 (facebookarchive#2268)
Summary: **Summary** Fixes facebookarchive#2261. This should be merged after facebookarchive#2267 (how I wish there were stacked diffs on GitHub) Migrate the website to Docusaurus 2 which provides the following benefits specific to Draft.js: - Consistency with the other FB Docusaurus websites - Easy way to import Draft.js (bundle via webpack, no more ugly client-side script tags) - Nicer CSS framework - Dark mode (disabled for now until I sort out the dark mode styling for the editor) Changes made: - I also changed the theme color of Draft.js to be lighter brown so that the contrast is better in general (much better on dark mode). Let me know if this is not ok. **Test Plan** <img width="1552" alt="Screen Shot 2019-11-30 at 9 16 32 PM" src="https://user-images.githubusercontent.com/1315101/69909874-bc28fd80-13b6-11ea-90bb-c6b44a1186a5.png"> <img width="1552" alt="Screen Shot 2019-11-30 at 9 16 39 PM" src="https://user-images.githubusercontent.com/1315101/69909875-bcc19400-13b6-11ea-9eda-c6eabfc4fde4.png"> Try it out here - https://build-swart-eight.now.sh Pull Request resolved: facebookarchive#2268 Reviewed By: mrkev Differential Revision: D18758642 Pulled By: yangshun fbshipit-source-id: 169087f716ef2792dade75388b86debbaf34ac44
- Loading branch information
1 parent
8645934
commit ee248df
Showing
22 changed files
with
4,898 additions
and
2,965 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
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,21 @@ | ||
# Dependencies | ||
node_modules | ||
|
||
# Production | ||
build | ||
|
||
# Generated files | ||
.docusaurus | ||
.cache-loader | ||
|
||
# Misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
# Logs | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
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 |
---|---|---|
@@ -1,21 +1,33 @@ | ||
Draft.js uses Docusaurus to maintain our documentation website. Please see the | ||
[Docusaurus Documentation](https://docusaurus.io/) for more info. | ||
# Draft.js website | ||
|
||
# Run the server | ||
This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern static website generator. | ||
|
||
The first time, get all the dependencies loaded via | ||
### Installation | ||
|
||
```bash | ||
yarn | ||
``` | ||
$ yarn | ||
``` | ||
|
||
### Local Development | ||
|
||
``` | ||
$ yarn start | ||
``` | ||
|
||
in the root directory. | ||
This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server. | ||
|
||
Then, run the server via | ||
### Build | ||
|
||
```bash | ||
npm start | ||
Open http://localhost:3000 | ||
``` | ||
$ yarn build | ||
``` | ||
|
||
This command generates static content into the `build` directory and can be served using any static contents hosting service. | ||
|
||
### Deployment | ||
|
||
``` | ||
$ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy | ||
``` | ||
|
||
Anytime you change the contents, refresh the page and it's going to be updated | ||
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. |
This file was deleted.
Oops, something went wrong.
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,104 @@ | ||
/** | ||
* 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: 'Draft.js', | ||
tagline: 'Rich Text Editor Framework for React', | ||
url: 'https://draftjs.org', | ||
baseUrl: '/', | ||
organizationName: 'facebook', | ||
projectName: 'draft-js', | ||
favicon: 'img/draftjs-logo.ico', | ||
presets: [ | ||
[ | ||
'@docusaurus/preset-classic', | ||
{ | ||
docs: { | ||
path: '../docs', | ||
sidebarPath: require.resolve('./sidebars.json'), | ||
editUrl: 'https://github.com/facebook/draft-js/edit/master/docs', | ||
showLastUpdateAuthor: true, | ||
showLastUpdateTime: true, | ||
}, | ||
theme: { | ||
customCss: require.resolve('./src/css/custom.css'), | ||
}, | ||
}, | ||
], | ||
], | ||
themeConfig: { | ||
disableDarkMode: true, | ||
navbar: { | ||
title: 'Draft.js', | ||
logo: { | ||
alt: 'Draft.js Logo', | ||
src: 'img/draftjs-logo.svg', | ||
}, | ||
links: [ | ||
{to: 'docs/getting-started', label: 'Docs', position: 'right'}, | ||
{ | ||
href: 'https://github.com/facebook/draft-js', | ||
label: 'GitHub', | ||
position: 'right', | ||
}, | ||
], | ||
}, | ||
algolia: { | ||
apiKey: 'ae94c9e3ee00ea8edddd484adafc37cd', | ||
indexName: 'draft-js', | ||
}, | ||
googleAnalytics: { | ||
trackingID: 'UA-44373548-19', | ||
}, | ||
footer: { | ||
style: 'dark', | ||
links: [ | ||
{ | ||
title: 'Docs', | ||
items: [ | ||
{ | ||
label: 'Getting Started', | ||
to: 'docs/getting-started', | ||
}, | ||
{ | ||
label: 'API Reference', | ||
to: 'docs/api-reference-editor', | ||
}, | ||
], | ||
}, | ||
{ | ||
title: 'Community', | ||
items: [ | ||
{ | ||
label: 'Stack Overflow', | ||
href: 'https://stackoverflow.com/questions/tagged/draftjs', | ||
}, | ||
{ | ||
label: 'Twitter', | ||
href: 'https://twitter.com/draft_js', | ||
}, | ||
], | ||
}, | ||
{ | ||
title: 'More', | ||
items: [ | ||
{ | ||
label: 'GitHub', | ||
href: 'https://github.com/facebook/draft-js', | ||
}, | ||
], | ||
}, | ||
], | ||
logo: { | ||
alt: 'Facebook Open Source Logo', | ||
src: '/img/oss_logo.png', | ||
href: 'https://opensource.facebook.com/', | ||
}, | ||
copyright: `Copyright © ${new Date().getFullYear()} Facebook, Inc.`, | ||
}, | ||
}, | ||
}; |
Oops, something went wrong.